Add subscriptions in 10 minutes

No Stripe headaches.
SDK + UI + usage billing included.

Complete billing system for Next.js. CLI setup, pre-built components, and automatic webhook handling. Stop wrestling with Stripe docs.

10-min setup
Open source
TypeScript SDK
No vendor lock-in
terminal
bash
$ npx drew-billing-cli init
Detected: Next.js 16
Dependencies installed
Database configured
Templates ready
Visit http://localhost:3000/pricing

3 ways to bill your customers

Start with a complete example, customize from there

SaaS Starter

Complete SaaS template with auth, pricing page, and customer dashboard. Deploy in 10 minutes.

Better Auth integration
Pricing page
Customer portal

API Billing

Usage-based billing for APIs. Track requests, bill by usage tier, manage API keys.

Usage tracking
API key management
Metered billing

AI Credits

Credit-based billing for AI apps. Pre-purchase credits, track consumption, top-up flows.

Credit system
Usage analytics
Top-up UI

How it works

From zero to billing in 3 simple steps

1

Run the CLI

One command detects your framework, installs dependencies, and sets up your database.

2

Connect Stripe

Paste your Stripe keys. We create products, set up webhooks, and configure everything.

Auto-migrations
Webhooks ready
3

Ship your pricing page

Pre-built components ready to customize. Deploy and start accepting payments.

Visit /pricing — you're live!

Why not just use Stripe?

You can. But here's what you're signing up for:

Database schema for subscriptions

Stripe Only

Build yourself

@drewsepsi/billing

✓ Included

Webhook handling & retries

Stripe Only

Build yourself

@drewsepsi/billing

✓ Automatic

Customer portal UI

Stripe Only

Build yourself

@drewsepsi/billing

✓ Pre-built

Usage-based billing

Stripe Only

Complex API calls

@drewsepsi/billing

✓ One line

Subscription state management

Stripe Only

Manual sync

@drewsepsi/billing

✓ Automatic

Time to first payment

Stripe Only

2-3 weeks

@drewsepsi/billing

10 minutes

@drewsepsi/billing uses Stripe under the hood. We just handle the hard parts so you don't have to.

Everything you need to bill customers

A complete subscription platform that handles the complexity so you can focus on your product.

Webhooks

Process events exactly once

Our idempotency layer prevents duplicate subscription updates, ensuring your database stays in perfect sync with Stripe.

  • Automatic deduplication by event ID
  • Subscription lifecycle state machine
  • Automatic retry with exponential backoff
POST /api/stripe/webhook
checkout.session.completed
processed
customer.subscription.updated
processed
invoice.payment_failed
retry #2
TypeScript SDK

Code that writes itself

Full autocomplete and type checking right out of the box. Your editor shows you exactly what's available—no guessing needed.

Install in seconds
Just one npm command
Works with any framework
React, Vue, Svelte, vanilla JS
Clear error messages
Know immediately what went wrong
npm
install @drewsepsi/billing
// Install with npm, yarn, or pnpm
import { BillingSDK } from "@drewsepsi/billing";
// Check if user has an active subscription
const { hasSubscription } = await billing.getSubscription(userId);
// Get user feature access & limits
const { features, limits } = await billing.getEntitlements(userId);
Resilience

Never lose a webhook

Failed webhooks don't mean lost data. Our retry system runs every 5 minutes with exponential backoff up to 5 attempts.

Vercel Cron
*/5 * * * *
Retry Queue
Max 5 attempts
Attempt 1
Failed
Attempt 2
Retrying...
Attempt 3
Pending

Clean, predictable APIs

RESTful endpoints that return exactly what you need. No surprises.

POST/api/checkout

Create Stripe checkout session

View docs
GET/api/subscription/:userId

Get subscription status

View docs
GET/api/entitlements/:userId

Check feature access

View docs
Free. Open source. No vendor lock-in.

Stop wrestling with Stripe.
Start billing in 10 minutes.

Join developers who ship faster.
No credit card required to try.