Introduction
One unified, normalized TypeScript API over Polar, Lemon Squeezy, Stripe, Paddle, and Dodo Payments — zero dependencies and Workers-ready.
revenue-sdk gives you a single, normalized API for five billing providers — Polar, Lemon
Squeezy, Stripe, Paddle, and Dodo Payments — so you write your products, checkout,
subscription, customer-portal, and webhook logic once instead of five times.
It has zero runtime dependencies (raw fetch and Web Crypto only) and is edge-compatible: it
runs on Node.js ≥ 22, Cloudflare Workers (without nodejs_compat), Deno, Bun, and any other
Web-standard runtime.
Why revenue-sdk
One unified API
Swap the provider and the rest of your code stays the same. No per-provider branching.
Normalized types
Product, Price, Checkout, Customer, Subscription, Order — every model keeps the
untouched payload on a raw escape hatch.
One subscription status model
Seven statuses across all five providers, with cancelAtPeriodEnd split out so canceled always
means terminal.
Zero dependencies
Just fetch and Web Crypto. Nothing to audit, nothing to bloat your bundle.
Workers-ready
No node:* imports. Runs on Cloudflare Workers without nodejs_compat.
Webhook verify & parse
Standalone helpers per provider that take a Web-standard Request — no client needed.
Tree-shakable subpaths
Each provider lives on its own import subpath, so unused providers never reach your bundle.
Capability gating
Providers differ. The client throws unsupported instead of silently dropping an option.
A first look
import { createClient } from 'revenue-sdk';
import { polar } from 'revenue-sdk/polar';
const client = createClient({
provider: polar({ accessToken: process.env.POLAR_ACCESS_TOKEN! }),
});
const checkout = await client.checkouts.create({
items: [{ product: 'PRODUCT_ID' }],
customerEmail: '[email protected]',
successUrl: 'https://example.com/thanks',
});
console.log(checkout.url);
Switching providers means swapping the provider argument — the rest of your code stays the same.
Supported providers
Polar
Merchant of record. Organization access token, external sandbox. Import from revenue-sdk/polar.
Lemon Squeezy
Merchant of record. JSON, store-scoped, variants as products. Import from
revenue-sdk/lemon-squeezy.
Stripe
Payment processor. Pinned API version, form-encoded wire format. Import from
revenue-sdk/stripe.
Paddle
Merchant of record. Paddle.js checkout on your own domain. Import from revenue-sdk/paddle.
Dodo Payments
Merchant of record. Unversioned additive API. Import from revenue-sdk/dodo-payments.
In-memory testing provider
Seedable fake for your test suite. Import from revenue-sdk/testing.