Configuration basics
Your application requires these environment variables:.env.local
Environment-specific configuration
Local development
.env.local
Staging deployment
.env.staging
Production deployment
Vercel:- Go to Project Settings → Environment Variables
- Add each variable for Production environment
- Redeploy to apply changes
- Go to Site Settings → Build & Deploy → Environment
- Add environment variables
- Trigger new deploy
Configuration validation
The Starter Kit automatically validates configuration on startup vialib/deployment-mode.ts:
lib/deployment-mode.ts
Runtime configuration access
Server Components
Client Components
Server Actions
Request headers
The configuration automatically constructs required headers:Multi-project setup
To deploy the same codebase for multiple projects:- Create separate deployments (e.g., separate Vercel projects)
- Configure different environment variables for each
- Each deployment gets its own
PROJECT_IDandPROJECT_KEY
Troubleshooting
Configuration errors on startup
Configuration errors on startup
Check that:
- All required variables are set
- Project ID is valid UUID format
- API URL is valid HTTPS URL
- No extra whitespace in values
Environment variables not updating
Environment variables not updating
- Clear Next.js cache:
rm -rf .next - Restart development server
- For production: trigger new deployment
Next steps
Environment Variables
Complete variable reference
Deploy
Deploy to production

