GET
/
v1
/
oauth2
/
authorize
Typescript (SDK)
import { Polar } from "@polar-sh/sdk";

const polar = new Polar({
  accessToken: process.env["POLAR_ACCESS_TOKEN"] ?? "",
});

async function run() {
  const result = await polar.oauth2.authorize();

  console.log(result);
}

run();
{
  "client": {
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "client_id": "<string>",
    "client_name": "<string>",
    "client_uri": "<string>",
    "logo_uri": "<string>",
    "tos_uri": "<string>",
    "policy_uri": "<string>"
  },
  "sub_type": "<string>",
  "sub": {
    "id": "<string>",
    "email": "[email protected]",
    "avatar_url": "<string>"
  },
  "scopes": [
    "openid"
  ]
}

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Response

200 - application/json

Successful Response

client
object
required
sub_type
string
required
Allowed value: "user"
sub
object | null
required
scopes
enum<string>[]
required