Installation
Install revenue-sdk with npm, pnpm, yarn, or bun, check the runtime requirements, and learn the ESM subpath exports for each provider.
Install revenue-sdk from npm with your package manager of choice.
npm install revenue-sdkpnpm add revenue-sdkyarn add revenue-sdkbun add revenue-sdkRequirements
revenue-sdk ships as ESM only and depends on nothing but the platform’s fetch, Web Crypto,
TextEncoder, URL, and btoa/atob — all Web standards.
Node?string
Or any Web-API runtime: Cloudflare Workers (no nodejs_compat needed), Deno, and Bun.
string>= 22Module?string
Package "type": "module". No CommonJS build.
stringESMDependencies?string
Zero runtime dependencies.
string0There are no node:* imports anywhere in the package, so it drops into edge runtimes unchanged.
Subpath exports
The client lives at the package root; each provider factory lives on its own subpath so a bundler only pulls in the provider you actually import. Every provider subpath also exports that provider’s standalone webhook helpers, and the providers with license keys additionally export the standalone license functions.
| Import | Exports |
|---|---|
revenue-sdk |
createClient, RevenueError, detectWebhookProvider, and all normalized types |
revenue-sdk/polar |
polar, verifyWebhook, parseWebhookEvent, validateLicenseKey, activateLicenseKey, deactivateLicenseKey |
revenue-sdk/lemon-squeezy |
lemonSqueezy, verifyWebhook, parseWebhookEvent, validateLicenseKey, activateLicenseKey, deactivateLicenseKey |
revenue-sdk/stripe |
stripe, verifyWebhook, parseWebhookEvent |
revenue-sdk/paddle |
paddle, verifyWebhook, parseWebhookEvent |
revenue-sdk/dodo-payments |
dodoPayments, verifyWebhook, parseWebhookEvent, validateLicenseKey, activateLicenseKey, deactivateLicenseKey |
revenue-sdk/testing |
createInMemoryProvider, signWebhook |
Import the client and a provider
import { createClient } from 'revenue-sdk';
import { stripe } from 'revenue-sdk/stripe';
const client = createClient({
provider: stripe({ secretKey: process.env.STRIPE_SECRET_KEY! }),
});
The webhook helpers are imported separately and never need a client:
import { parseWebhookEvent, verifyWebhook } from 'revenue-sdk/stripe';
Continue to the Quickstart
Create a client, create a checkout, handle a webhook, and check subscription status.