billingsdk

Polar

Open-source billing with checkout, subscriptions, Svix webhooks, and merchant of record.

Installation

npm install billingsdk-core billingsdk-polar

Configuration

import { polar } from "billingsdk-polar";

const adapter = polar({
  accessToken: process.env.POLAR_ACCESS_TOKEN!,
  webhookSecret: process.env.POLAR_WEBHOOK_SECRET,
  organizationId: process.env.POLAR_ORGANIZATION_ID,
});

Capabilities

Checkout
Subscriptions
Invoices
Plan Sync
Customer Portal

Webhook Verification

Uses the Svix standard — Polar sends webhook-id, webhook-timestamp, and webhook-signature headers. Verified with HMAC-SHA256.