This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.
Creates a client for authenticating users with OAuth.
// The user did not complete the authorization flow
}
TS
getAccessTokenfunction
Gets the access token and scopes for the current user.
When a token expires, it's automatically refreshed by Canva.
The token is cached by Canva, so the app's frontend shouldn't store the token.
Parameters
requestAccessTokenRequest
Optional
Options for requesting an access token for the current user.
forceRefreshboolean
Optional
If true, the access token will be refreshed, even if it hasn't expired.
By default, access tokens are automatically refreshed after expiry.
scopeSet<string>
Optional
The scopes associated with the access token.
Returns
The access token and scopes for the current user, or null if the user isn't authorized. This is a Promise that resolves with either undefined or the following object:
tokenstring
The access token for the current user.
scopeSet<string>
The scopes associated with the current user's access token.