getAuthToken()
function getAuthToken(args: AuthTokenRequestArgs, baseUrl?: string): Promise<AuthTokenResponse>
Exchanges an authorization code for an access token.
Parameters
Parameter | Type |
---|---|
args | AuthTokenRequestArgs |
baseUrl ? | string |
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