Environment Variables
Configure your deployment with environment variables.
Overview
Environment variables allow you to configure your application for different environments without changing code.
Setting Environment Variables
Via Dashboard
- Navigate to your project settings
- Click on “Environment Variables”
- Add key-value pairs
- Save and redeploy
Via API
curl -X POST https://api.irresistible.dev/projects/PROJECT_ID/env
-H "Authorization: Bearer YOUR_TOKEN"
-d '{"key": "API_KEY", "value": "secret-value"}'
Common Variables
Application Settings
NODE_ENV=production
PORT=3000
PUBLIC_URL=https://myapp.irresistible.dev
Database Configuration
DATABASE_URL=postgresql://user:pass@host:5432/db
DB_POOL_SIZE=10
DB_TIMEOUT=30000
API Keys
STRIPE_API_KEY=sk_live_...
SENDGRID_API_KEY=SG...
AWS_ACCESS_KEY_ID=AKIA...
Environment-Specific Variables
Development
DEBUG=true
LOG_LEVEL=debug
ENABLE_HOT_RELOAD=true
Production
DEBUG=false
LOG_LEVEL=error
ENABLE_CACHE=true
Security Best Practices
- Never commit secrets to version control
- Use different values for each environment
- Rotate secrets regularly
- Limit access to production variables
- Encrypt sensitive values at rest
Variable Precedence
- Environment-specific files (.env.production)
- Local .env file
- System environment variables
- Default values in code
Reserved Variables
These variables are set automatically:
IRRESISTIBLE_PROJECT_ID
IRRESISTIBLE_DEPLOYMENT_ID
IRRESISTIBLE_REGION
IRRESISTIBLE_URL