User Avatar

Deploying

Setup Stripe webhooks

  1. Sign in to your Stripe dashboard and navigate to Webhooks.
  2. Click on Add an endpoint.
  3. Enter the following Endpoint URL: https://your-app.com/api/webhooks/stripe.
  4. Select the events you want to listen to from Stripe.

The following events are required:

/**
* Supported Stripe Webhook Events
* events are processed in the event service. services/event.ts
*
*/
export const supportedStripeEvents = new Set([
"checkout.session.completed",
"customer.subscription.deleted",
"customer.subscription.updated",
"invoice.created",
"invoice.finalized",
"invoice.paid",
"payment_method.attached",
"product.created",
"product.deleted",
"product.updated",
"price.created",
"price.deleted",
"price.updated",
])
  1. Click on Add endpoint.

Deploy to Vercel

  1. Push your code to your Git repository.
  2. Create a new Vercel project and Import your Git repository.
  • Choose the Next.js preset.
  • Set the Node version to 20.x
  1. Set the environment variables in Vercel. Make sure you are using the production environment variables for Stripe, Database, etc.
  2. Click on Deploy.

Note: StartStack comes with a vercel-build script key in the package.json file that will run the database migrations and build the app.

Note: See the Getting Started guide for more information on setting up your database and 3rd party services.