Node SDK
Zesty.io Software developer kit (SDK) with Node SDK
This is a basic example of how to setup an authenticated SDK instance and request data.
*Requires Nodejs installed on your system.
1) Use a package manager to install the SDK. e.g. npm install @zesty-io/sdk
2) Create an example file
1
// example/basic/index.js
2
3
const SDK = require("@zesty-io/sdk");
4
5
// !!! Do not commit your password to a repository. This needs to stay secret.
6
// We only have you enter it here for simplicity of the example.
7
// Add your user email, password and instance ZUID
8
const ZESTY_USER_EMAIL = "";
9
const ZESTY_USER_PASSWORD = "";
10
const ZESTY_INSTANCE_ZUID = "";
11
12
async function main() {
13
// Get authenticated session
14
const auth = new SDK.Auth();
15
const session = await auth.login(ZESTY_USER_EMAIL, ZESTY_USER_PASSWORD);
16
17
// Instantiate sdk instance with instance ZUID and authenticated session token
18
const sdk = new SDK(ZESTY_INSTANCE_ZUID, session.token);
19
20
// Request instance data
21
const res = await sdk.instance.getModels();
22
23
// View our response data in the console
24
console.log(res.data);
25
}
26
27
// Run the function
28
main();
Copied!
3) Run the example with node index.js

Further explanations of the example code

Last modified 1yr ago
Export as PDF
Copy link