Setup Stripe webhooks
- Sign in to your Stripe dashboard and navigate to Webhooks.
- Click on
Add an endpoint
. - Enter the following Endpoint URL:
https://your-app.com/api/webhooks/stripe
. - 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",])
- Click on
Add endpoint
.
Deploy to Vercel
- Push your code to your Git repository.
- Create a new Vercel project and Import your Git repository.
- Choose the Next.js preset.
- Set the Node version to 20.x
- Set the environment variables in Vercel. Make sure you are using the production environment variables for Stripe, Database, etc.
- Click on
Deploy
.
Note: StartStack comes with a
vercel-build
script key in thepackage.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.