Environment Variables
ConfigurationUsing environment variables in Next.js
Examples
Common usage examples
Set public env variable
NEXT_PUBLIC_API_URL=https://api.example.com next devBuild for production
NODE_ENV=production next buildNotes
- Use NEXT_PUBLIC_ prefix for browser-accessible variables
- Create .env.local for local development
- .env.production for production builds
Related Commands
You might also find these useful