API reference
Design
Platform
auth.getCanvaUserToken
API reference for the auth.getCanvaUserToken method.
This version of the API is deprecated. This version will soon be unsupported. You should use a stable version of the API in your app.
Gets a JSON Web Token (JWT) for the current user.
To learn more, see JSON Web Tokens.
Usage
import { auth } from "@canva/user";const token = await auth.getCanvaUserToken();console.log(token);
TS
Returns
A Promise
that resolves with the following string:
result
string
REQUIRED
The JSON Web Token for the current user.
When decoded and verified, an object is returned with the following properties:
aud
- The ID of the app.brandId
- The ID of the user's team(opens in a new tab or window).userId
- The ID of the user.