Request an access token using a valid grant.
Typescript
import { Polar } from "@polar-sh/sdk"; const polar = new Polar(); async function run() { const result = await polar.oauth2.token({ grantType: "authorization_code", clientId: "<id>", clientSecret: "<value>", code: "<value>", redirectUri: "https://memorable-season.name", }); console.log(result); } run();
{ "access_token": "<string>", "token_type": "<string>", "expires_in": 123, "refresh_token": "<string>", "scope": "<string>", "id_token": "<string>" }
"authorization_code"
1 - 2083
Successful Response
"Bearer"
Was this page helpful?