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
Name | Type | Required | Description |
---|---|---|---|
accountId | string | No | The account ID to associate with the token |
permissions | Partial<MethodsPermissions> | No | Custom permissions to override the default permissions |
expiresInSeconds | number | No | Token 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' });