Skip to content

Going to Production

When you’re ready to deploy your SaaS application to production, follow these steps:

  1. Go to the Stripe Dashboard and create a new webhook for your production environment.
  2. Set the endpoint URL to your production API route (e.g., https://yourdomain.com/api/stripe/webhook).
  3. Select the events you want to listen for (e.g., checkout.session.completed, customer.subscription.updated).
  1. Push your code to a GitHub repository.
  2. Connect your repository to Vercel and deploy it.
  3. Follow the Vercel deployment process, which will guide you through setting up your project.

In your Vercel project settings (or during deployment), add all the necessary environment variables. Make sure to update the values for the production environment, including:

  1. DEPLOYMENT_PLATFORM: Set this to vercel
  2. PUBLIC_URL: Set this to your production domain.
  3. STRIPE_SECRET_KEY: Use your Stripe secret key for the production environment.
  4. STRIPE_WEBHOOK_SECRET: Use the webhook secret from the production webhook you created in step 1.
  5. DATABASE_URL: Set this to your production database URL.
  6. AUTH_SECRET: Set this to a random string. openssl rand -base64 32 will generate one.
  7. SECRET_KEY_BASE: Set this to a random string. openssl rand -base64 32 will generate one.
  8. OPENAI_API_KEY: Set this to your OpenAI key.