BetterStarter logoBetterStarter
Features

Payments

Stripe integration for one-time purchases and subscriptions.

Docs are in beta — content is improving rapidly. Found something missing? Open an issue on GitHub or reach out on Twitter.

BetterStarter integrates Stripe for billing with a clean, provider-agnostic architecture.

What's Included

  • One-time payments — lifetime access / single purchase
  • Subscriptions — recurring monthly or annual billing
  • Entitlements — track what products/plans each user has access to
  • Webhook handlingcheckout.session.completed, subscription lifecycle events
  • Customer portal — let users manage their subscription
  • Billing dashboard — admin can view and manage user billing

Environment Variables

STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
VITE_STRIPE_PRODUCT_CORE_ID=prod_...
VITE_STRIPE_PRICE_CORE_ONE_TIME_ID=price_...
VITE_STRIPE_PROMOTION_CODE_ID=promo_...   # optional

Architecture

FilePurpose
src/features/billing/config.tsProduct/price IDs and config
src/features/billing/server.tsServer functions: create checkout/portal sessions
src/routes/api/stripe/webhook.tsIncoming Stripe webhook handler

Local Webhook Testing

stripe login
stripe listen --forward-to localhost:3000/api/stripe/webhook

Copy the whsec_... signing secret to STRIPE_WEBHOOK_SECRET.

Test Card

Use 4242 4242 4242 4242 with any future expiry and any CVC in Stripe's test mode.

On this page