@polar-sh/sdk is the official TypeScript client for the Polar API. It requires Node.js 24 or later.
Install
- npm
- yarn
- pnpm
Terminal
Create a client
Create an organization access token in Settings → Access Tokens, or runpolar auth token, and store it in POLAR_ACCESS_TOKEN. Then make your first request:
index.ts
2026-10: its types and the Polar-Version header it sends. See SDKs.
Use the token on your server only. Never bundle it into browser code.
Options
List resources
List methods return one page.iterList yields every item across pages:
Handle errors
Every SDK error extendsPolarError, exported from @polar-sh/sdk. Errors the API documents, such as ResourceNotFound, have their own classes under errors:
Verify webhooks
webhooks.validateEvent checks the signature and returns a typed event:
Send usage events
polar.events.ingest sends a list of usage events in one request:
Framework adapters
Adapters add checkout, Customer Portal and webhook routes in a few lines: Adapters for other frameworks are deprecated. Use the SDK directly instead. Thepolar-integration skill helps your coding agent integrate or migrate:

