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 SettingsDevelopers 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 SettingsDevelopersWebhooks and click Add endpoint.

Enter your production endpoint URL:

https://your-domain.com/api/stripe/webhook

If your production URL redirects to the www subdomain, include it in the URL to avoid 308 redirect errors.

Select the following events:

  • checkout.session.completed
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_succeeded

Click Add endpoint.

Alternatively, use the provided command to automatically create the webhook endpoint:

pnpm payments:webhook

In order for the command above to work, you need to update your .env file:

  • set NEXT_PUBLIC_APP_ENV to production
  • set NEXT_PUBLIC_DASHBOARD_URL to your production dashboard URL
  • set STRIPE_PUBLISHABLE_KEY and STRIPE_SECRET_KEY to 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:push

This 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 SettingsBusinessCustomer emails, enable:

  • Successful payments.
  • Refunds.

In SettingsBillingSubscriptions and emails, enable:

  • Send finalized invoices and credit notes to customers.
  • Send emails about expiring cards.
  • Send emails when card payments fail.