Skip to main content

Token

Description

The Token module is used to create authentication tokens for other SDKs. These tokens are used to authenticate and authorize requests to the API.

Methods

create

Creates a new JWT token that can be used to authenticate requests. You need to provide it to authToken function in the client SDK.

If you don't provide account id, the token will be created for the root account.

Props

NameTypeRequiredDescription
accountIdstringNoThe account ID to associate with the token
permissionsPartial<MethodsPermissions>NoCustom permissions to override the default permissions
expiresInSecondsnumberNoToken expiration time in seconds. Defaults to 3600 (1 hour)

Returns

string - A JWT token that can be used for authentication

Example

const token = await sdk.tokens.create({ accountId: '123' });