Deployment
We will be using Vercel (opens in a new tab) to deploy our app. Vercel is a cloud platform for static sites and Serverless Functions that fits perfectly with our Next.js app.
Create a Vercel account
Go to Vercel (opens in a new tab) and create an account. Import your GitHub account and create a new project from the repository you created in the previous step.
Configure environment variables
Go to your project settings and add the following environment variables, replacing the local values with production values:
Variable Name | Value |
---|---|
NEXTAUTH_URL | Your production URL |
NEXT_PUBLIC_APP_URL | Your production URL |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Your Live Stripe publishable key |
STRIPE_SECRET_KEY | Your Live Stripe secret key |
STRIPE_WEBHOOK_SECRET | Your Live Stripe webhook secret |
NEXT_PUBLIC_STRIPE_PRICE_ID | Your Live Stripe price ID |
Automatic deployments
Now everytime you push to your repository, Vercel will automatically deploy your app.