Deployment
Deploy to production with Vercel.
VelocityKit is optimized for deployment on Vercel.
Deploy to Vercel
Option 1: Git Integration (Recommended)
- Push your code to GitHub
- Go to vercel.com and import your repository
- Add environment variables (see below)
- Deploy
Every push to your main branch will trigger a new deployment.
Option 2: CLI
# Deploy to preview
pnpm ship
# Deploy to production
pnpm ship --prod
Environment Variables
Add these environment variables in your Vercel project settings:
Required
# App
NEXT_PUBLIC_APP_URL=https://your-domain.com
# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=eyJhbGc...
SUPABASE_SECRET_KEY=eyJhbGc...
# Stripe (prices are fetched automatically from Stripe)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_xxx
STRIPE_SECRET_KEY=sk_live_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
Recommended
# PostHog
NEXT_PUBLIC_POSTHOG_KEY=phc_xxx
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
# Resend
RESEND_API_KEY=re_xxx
RESEND_FROM_EMAIL=hello@yourdomain.com
Optional
# Rate Limiting (Upstash Redis)
UPSTASH_REDIS_REST_URL=https://xxx.upstash.io
UPSTASH_REDIS_REST_TOKEN=xxx
# Social Login Providers
NEXT_PUBLIC_AUTH_PROVIDERS=google,github
# AI Features
AI_PROVIDER=openai
OPENAI_API_KEY=sk-xxx
# Notifications
SLACK_WEBHOOK_URL=https://hooks.slack.com/xxx
Production Checklist
Before going live:
Stripe
- Switch from test to live API keys
- Create production webhook endpoint
- Create live products and prices
- Test a real payment
Supabase
- Run all migrations on production
- Verify RLS policies are working
- Enable email confirmations (optional)
- Configure social auth providers
Domain
- Configure custom domain in Vercel
- Set up DNS records
- Verify domain in Resend
Security
- Review environment variables
- Enable MFA for service accounts
- Set up monitoring and alerts
Monitoring
Vercel Analytics
Enable Vercel Analytics for:
- Page performance metrics
- Core Web Vitals
- Traffic insights
PostHog
Use PostHog for:
- User behavior analytics
- Feature flag usage
- Session replays (optional)
Error Tracking
Consider adding error tracking:
Scaling Considerations
VelocityKit is designed to scale with your business:
- Database — Supabase scales automatically, upgrade plan as needed
- Hosting — Vercel handles scaling, consider Edge functions for global performance
- Billing — Stripe handles high transaction volumes
- Email — Resend scales with your sending volume
Rollback
If something goes wrong:
# Vercel dashboard
# Go to Deployments → Select previous → Promote to Production
# Or via CLI
vercel rollback
Always test deployments in preview before promoting to production.