Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Polar

Scalekit connector
Open markdown

The Polar connector lets your AI agent act in each user's Polar account. Each user connects their own Polar access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 60 tools.

Tools
60
What they doRead · write · destructive
36 · 19 · 536 read19 write5 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Polar connection

    In AgentKit > Connections, create a Polar connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'polar'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Polar:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'polar_benefits_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Polar credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • polar_benefit_getGet a benefit by ID.Read-only

    Get Benefit

    Get a benefit by ID. Returns the benefit with type, description and type-specific properties. Use polar_benefit_get when you have the ID.

    Inputs

    idstringrequired
    Benefit ID (UUID). Example: 8f2c4a9e-1b3d-4e5f-9a7b-6c8d0e1f2a3b.
  • polar_benefit_grants_listList the customers who were granted a benefit, optionally only current or revoked grants.Read-only

    List Benefit Grants

    List the customers who were granted a benefit, optionally only current or revoked grants. Returns items[] of grants with customer, granted_at, revoked_at and is_granted. Use polar_benefit_grants_list to see who has access.

    Inputs

    idstringrequired
    Benefit ID (UUID). Example: 8f2c4a9e-1b3d-4e5f-9a7b-6c8d0e1f2a3b.
    customer_idstring
    Only grants of this customer ID. Example: 992fae2a-2a17-4b7a-8d9e-e287cf90131b.
    is_grantedboolean
    true for current grants, false for revoked. Example: true.
    limitinteger
    Page size, up to 100. Defaults to 10. Example: 50.
    pageinteger
    Page number, starting at 1. Defaults to 1. Example: 1.
  • polar_benefits_listList benefits (license keys, file downloads, GitHub or Discord access, custom perks), optionally by type or description.Read-only

    List Benefits

    List benefits (license keys, file downloads, GitHub or Discord access, custom perks), optionally by type or description. Returns items[] of benefits with id, type, description and properties. Use polar_benefits_list to find a benefit ID.

    Inputs

    limitinteger
    Page size, up to 100. Defaults to 10. Example: 50.
    pageinteger
    Page number, starting at 1. Defaults to 1. Example: 1.
    querystring
    Text to match against the description. Example: Pro license.
    sortingstring
    Sort criterion; prefix with - for descending, for example -created_at. Example: -created_at.
    typestring
    Benefit type. Example: license_keys.one of customdiscordgithub_repositorydownloadableslicense_keysmeter_creditfeature_flagslack_shared_channel
  • polar_checkout_getGet a checkout session by ID.Read-only

    Get Checkout Session

    Get a checkout session by ID. Returns the checkout with status, url, products, amounts, discount and customer details. Use polar_checkout_get to check whether a checkout succeeded.

    Inputs

    idstringrequired
    Checkout session ID (UUID). Example: 8f2c4a9e-1b3d-4e5f-9a7b-6c8d0e1f2a3b.
  • polar_checkouts_listList checkout sessions, filtered by product, customer, status or customer email.Read-only

    List Checkout Sessions

    List checkout sessions, filtered by product, customer, status or customer email. Returns items[] of checkouts with id, status, url, amount and customer details. Use polar_checkouts_list to track open or abandoned checkouts.

    Inputs

    customer_idstring
    Only checkouts for this customer ID. Example: 992fae2a-2a17-4b7a-8d9e-e287cf90131b.
    external_customer_idstring
    Only checkouts for this external customer ID. Example: usr_1337.
    limitinteger
    Page size, up to 100. Defaults to 10. Example: 50.
    pageinteger
    Page number, starting at 1. Defaults to 1. Example: 1.
    product_idstring
    Only checkouts for this product ID. Example: d8f6a1c2-5b3e-4f7a-9c1d-2e3f4a5b6c7d.
    querystring
    Customer email to filter by. Example: jane@example.com.
    sortingstring
    Sort criterion; prefix with - for descending, for example -created_at. Example: -created_at.
    statusstring
    Checkout status. Example: open.one of openexpiredconfirmedsucceededfailed
  • polar_customer_getGet a customer by Polar ID.Read-only

    Get Customer

    Get a customer by Polar ID. Returns the customer with email, name, external_id, billing address, tax ID and metadata. Use polar_customer_get when you have the Polar ID. Use polar_customer_get_by_external_id with your own ID.

    Inputs

    idstringrequired
    Polar customer ID (UUID). Example: 992fae2a-2a17-4b7a-8d9e-e287cf90131b.