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
// example/basic/index.js​const SDK = require("@zesty-io/sdk");​// !!! Do not commit your password to a repository. This needs to stay secret.// We only have you enter it here for simplicity of the example.// Add your user email, password and instance ZUIDconst ZESTY_USER_EMAIL = "";const ZESTY_USER_PASSWORD = "";const ZESTY_INSTANCE_ZUID = "";​async function main() {// Get authenticated sessionconst auth = new SDK.Auth();const session = await auth.login(ZESTY_USER_EMAIL, ZESTY_USER_PASSWORD);​// Instantiate sdk instance with instance ZUID and authenticated session tokenconst sdk = new SDK(ZESTY_INSTANCE_ZUID, session.token);​// Request instance dataconst res = await sdk.instance.getModels();​// View our response data in the consoleconsole.log(res.data);}​// Run the functionmain();
3) Run the example with node index.js
​Requesting instance data​