GuidesDeployment
Service Configuration
Configure Convex, Stripe, and email services for production
Service Configuration
Convex Production
Get Production URL
# Output example:
# Deployment: prod:happy-animal-123
# URL: https://happy-animal-123.convex.cloudAdd to Vercel environment variables:
CONVEX_DEPLOYMENT=prod:happy-animal-123
NEXT_PUBLIC_CONVEX_URL=https://happy-animal-123.convex.cloudSet Environment Variables
npx convex env set STRIPE_SECRET_KEY sk_live_... --prod
npx convex env set RESEND_API_KEY re_... --prod
npx convex env set BETTER_AUTH_SECRET your-secret --prodStripe Production
Switch to Live Mode
In Stripe Dashboard, toggle from Test to Live mode.
Get Live API Keys
- Go to Developers → API Keys
- Copy Publishable key and Secret key
- Add to Vercel:
STRIPE_SECRET_KEY=sk_live_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...Configure Webhook
- Go to Developers → Webhooks
- Click Add endpoint
- URL:
https://yourdomain.com/api/webhooks/stripe - Select events:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
- Copy Signing secret:
STRIPE_WEBHOOK_SECRET=whsec_...Test Webhook
stripe listen --forward-to https://yourdomain.com/api/webhooks/stripe
stripe trigger checkout.session.completedEmail Service (Resend)
Create API Key
- Go to Resend Dashboard
- Click Create API Key
- Add to Vercel:
RESEND_API_KEY=re_...
BETTER_AUTH_EMAIL_FROM=noreply@yourdomain.comVerify Domain
- Go to Domains in Resend
- Add your domain
- Add DNS records:
Type: TXT
Name: resend._domainkey
Value: (provided by Resend)Better Auth
# Generate secret
BETTER_AUTH_SECRET=$(openssl rand -base64 32)
# Set URL
BETTER_AUTH_URL=https://yourdomain.comOAuth Providers
GitHub OAuth
Update callback URL:
https://yourdomain.com/api/auth/callback/githubGoogle OAuth
Update authorized redirect:
https://yourdomain.com/api/auth/callback/googleAlways use live mode keys in production. Never commit secrets to git.
Health Checks
Test each service:
# Test Convex
curl https://your-deployment.convex.cloud/_system/ping
# Test Stripe
stripe webhooks test --endpoint https://yourdomain.com/api/webhooks/stripe
# Test Email
# Send test email via Resend dashboard