Payments

Add subscriptions and checkout flows with webhook-driven access control.

Last updated December 18, 2025

At a glance

What you get
  • Checkout flow
  • Webhook handling
  • Subscription state tracking
You'll configure
  • Payment provider keys
  • Webhook secret
  • Product IDs / price IDs

Quickstart

1
Add payment provider keys

Add your provider API keys and webhook secret to .env.local (POLAR_ACCESS_TOKEN, POLAR_WEBHOOK_SECRET, etc.).

2
Create subscription products

Create your subscription tiers/prices in your provider dashboard (Polar.sh, Stripe, etc.).

3
Configure webhook endpoint

Point webhooks to your app's /api/webhooks/[provider] route and verify signature validation is enabled.

4
Test checkout flow

Visit /pricing, select a plan, complete checkout, and verify subscription state updates in the dashboard.

Providers

Pick an option below. Each provider has a short guide so you can implement without digging through docs.

Polar
Available
Expand

Default in the current scaffold. Subscriptions + customer portal with Polar.

Stripe
Coming soon
Expand

Industry standard payments. Subscriptions, invoices, coupons, and more.

Lemon Squeezy
Coming soon
Expand

Fast SaaS billing and digital products with a simple setup.

Code

Copy/paste-friendly code blocks. Designed to get you working quickly without digging through long docs.

.env.local (Polar)

Keys needed to enable checkout + webhook handling.

# Polar
POLAR_ACCESS_TOKEN="your-polar-access-token"
POLAR_WEBHOOK_SECRET="your-webhook-secret"
POLAR_SUCCESS_URL="http://localhost:3000/success"
NEXT_PUBLIC_STARTER_TIER="your-starter-tier-id"
NEXT_PUBLIC_STARTER_SLUG="your-org-slug"
Run a local webhook test

Once deployed, you’ll point your provider’s webhook to your /api route.

$ # provider dashboard → set webhook URL
$ # verify signature validation is enabled