Instantiation
Guide in setting up authenticated instance using node SDK
The first step in using the SDK is setting up an authenticated instance.
We use an async
function since we need to await
the asynchronus authentication service response. Internally the login
function will cache the returned the authentication token and use it for subsequent requests. As well as it will handle re-issuing a token when the one in use expires.
All API requests must be authenticated
User Level Authentication
#The SDK has user level authentication meaning the actions allowed against the instance will depend on the role and privileges of the user account you authenticate with.
For example; If the user account you instantiate the SDK with has a role of contributor you will be able to create and update content items but will not be able to delete or publish content items.
When using the SDK we recommend these 2 things for authenticating.
- An account created specifically for using with the SDK
- The role of
developer
for the SDK user
async /await syntax
Reference: async/await syntax
Promise syntax
Reference: promise syntax
Connect with Content Experts
Book a free 15-minute consultation with a content expert. Discuss your application, pain points and requirements. Understand how Zesty's lower total cost of ownership, features, functionality can elevate your business by creating extraordinary digital experiences.
Trusted By
G2 MOMENTUM LEADER