Stripe
Configure Stripe for production payments.
Get Stripe Keys
Turn off test mode
In the Stripe dashboard, uncheck the Test mode switch at the top right.
Get the Stripe keys
Go to Settings → Developers and click Manage API keys.
Copy the Publishable key and Secret key. Save them — you'll need it when configuring your hosting provider.
Create a webhook endpoint
Go to Settings → Developers → Webhooks and click Add endpoint.
Enter your production endpoint URL:
https://your-domain.com/api/stripe/webhookIf your production URL redirects to the www subdomain, include it in the URL to avoid 308 redirect errors.
Select the following events:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeeded
Click Add endpoint.
Alternatively, use the provided command to automatically create the webhook endpoint:
pnpm payments:webhookIn order for the command above to work, you need to update your .env file:
- set
NEXT_PUBLIC_APP_ENVtoproduction - set
NEXT_PUBLIC_DASHBOARD_URLto your production dashboard URL - set
STRIPE_PUBLISHABLE_KEYandSTRIPE_SECRET_KEYto your production Stripe keys
Get the webhook signing secret
Click the webhook endpoint and reveal the Signing secret. Save it alongside the Stripe keys.
Push Subscription Plans
With your production Stripe keys in .env, run:
pnpm payments:pushThis creates your subscription plans in the live Stripe environment.
Configure the Customer Portal
Repeat the same customer portal configuration as in development, but in the live Stripe environment.
Follow the instructions in the Customer Portal section.
Enable Automatic Emails
In Settings → Business → Customer emails, enable:
- Successful payments.
- Refunds.
In Settings → Billing → Subscriptions and emails, enable:
- Send finalized invoices and credit notes to customers.
- Send emails about expiring cards.
- Send emails when card payments fail.