Skip to content

Money

Payments

Pick a provider in one line of config. Both implement the same BillingProvider interface and feed the same entitlement code, so the UI never knows which one is behind it.

  • Stripe
  • Polar

What you get

  • Polar plans mapped through productId, with sandbox or production by environment
  • Stripe Checkout Sessions for subscriptions or one-time payments
  • A customer portal for both providers
  • Webhooks verified, stored durably and processed by a job
  • applyEntitlement() and revokeEntitlement(), the one place a plan is applied

Turn it on

  • billingConfig.provider and plansConfig in config.ts
  • POLAR_* or STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET

Where it lives

  • lib/billing/provider.ts
  • lib/billing/entitlements.ts
  • lib/billing/stripe.ts
  • lib/billing/polar.ts