Payments with Stripe
Stripe is optional. When configured, users can start a Stripe Checkout flow from the app.Required variables
SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, and SUPABASE_SECRET_KEY for server configuration. Legacy names remain supported during migration.
Functions
create-checkout-session.ts creates a one-time Stripe Checkout session. When Supabase is enabled, it requires a valid access token; user identity, email, and Price ID are derived by the server.
stripe-webhook.ts verifies the signature, payment state, and purchased Price ID before invoking an idempotent database transaction that records payment and activates Premium. Guest support payments remain available for self-hosted deployments without Supabase, but do not grant Premium.
Stripe dashboard setup
- Create a Stripe product.
- Create a one-time price.
- Set the Price ID only in the trusted server variable
STRIPE_PRICE_ID. - Add your publishable key and secret key to the correct environments.
- Create a webhook endpoint for:
- Subscribe the endpoint to
checkout.session.completed. - Store the webhook signing secret in
STRIPE_WEBHOOK_SECRET.