Stripe
LaunchFast includes Stripe integration that is gated behind the STRIPE_ENABLED flag. All Stripe behavior is opt-in — nothing payment-related runs until you explicitly enable it.
Enabling Stripe
- In
app/utils/env.server.ts, uncommentSTRIPE_SECRET_KEYandSTRIPE_WEBHOOK_ENDPOINT - Get your Secret Key from the Stripe Dashboard and add it to your
.envfile - Set up your webhook endpoint (see below)
Webhook setup
Stripe webhooks notify your application about payment events (successful charges, subscription changes, refunds). Configure your webhook endpoint in the Stripe Dashboard under Developers, then Webhooks.
Set the endpoint URL to https://your-app.fly.dev/api/stripe/webhook (or your custom domain). Copy the webhook signing secret to STRIPE_WEBHOOK_ENDPOINT.
Local development with Stripe CLI
Use the Stripe CLI to forward webhook events to your local development server:
stripe listen --forward-to localhost:3000/api/stripe/webhookThe CLI prints a webhook signing secret — use this as your local STRIPE_WEBHOOK_ENDPOINT value.
Production deployment
Set Stripe secrets on Fly:
fly secrets set STRIPE_SECRET_KEY="sk_live_..." --app your-app-name
fly secrets set STRIPE_WEBHOOK_ENDPOINT="whsec_..." --app your-app-nameCorrectness invariants
Stripe webhooks are critical paths — webhook failure equals revenue loss. See the correctness invariants page for the full list of payment-related rules.
Proceed with extreme caution when modifying payment-related code.
Related
- Environment variables — full list of Stripe-related env vars