Back to DocumentationApp Deployment
Environment Variables
Manage secrets and configuration with environment variables.
April 12, 202633 views
Environment Variables
Adding Variables
- Go to your deployment settings
- Click Environment Variables
- Add key-value pairs
- Save - a new deployment is triggered automatically
Best Practices
- Never commit secrets - Use environment variables for API keys, database URLs, and passwords
- Use descriptive names -
DATABASE_URL,STRIPE_SECRET_KEY,API_BASE_URL - Separate environments - Use different values for staging and production
Common Variables
| Variable | Purpose |
|---|---|
DATABASE_URL | Database connection string |
NODE_ENV | Application environment (production) |
PORT | Application listening port |
API_KEY | Third-party API credentials |
Security
Environment variables are encrypted at rest and only exposed to your application during runtime. They are never visible in build logs.
environmentvariablessecretsconfig