getAuthToken()
function getAuthToken(args: AuthTokenRequestArgs, options?: AuthOptions): Promise<AuthTokenResponse>;
Exchanges an authorization code for an access token.
Parameters
| Parameter | Type |
|---|---|
args | AuthTokenRequestArgs |
options? | AuthOptions |
Returns
Promise<AuthTokenResponse>
The access token response
Example
const { accessToken } = await getAuthToken({
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
code: authCode
})
Throws
TodoistRequestError If the token exchange fails