Skip to content
revenue-sdk
Esc
navigateopen⌘Jpreview
On this page

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-sdk
pnpm add revenue-sdk
yarn add revenue-sdk
bun add revenue-sdk

Requirements

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.

PropType
Node?string

Or any Web-API runtime: Cloudflare Workers (no nodejs_compat needed), Deno, and Bun.

Typestring
Default>= 22
Module?string

Package "type": "module". No CommonJS build.

Typestring
DefaultESM
Dependencies?string

Zero runtime dependencies.

Typestring
Default0

There 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.

Import Exports
revenue-sdk createClient, RevenueError, detectWebhookProvider, and all normalized types
revenue-sdk/polar polar, verifyWebhook, parseWebhookEvent
revenue-sdk/lemon-squeezy lemonSqueezy, verifyWebhook, parseWebhookEvent
revenue-sdk/stripe stripe, verifyWebhook, parseWebhookEvent
revenue-sdk/paddle paddle, verifyWebhook, parseWebhookEvent
revenue-sdk/dodo-payments dodoPayments, verifyWebhook, parseWebhookEvent
revenue-sdk/testing createInMemoryProvider

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.

Last updated on August 6, 2026

Was this page helpful?