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 (for example
SteadyRenew Premium). - Create a one-time Price of **6 Price — create a new Price and keep the product if you want.
- Copy the new Price ID (
price_...) into the trusted server variableSTRIPE_PRICE_ID. Optionally keepVITE_STRIPE_PRICE_IDonly as a legacy server fallback; the browser does not trust it for checkout. - 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.