Environment Variables
Securely manage secrets and configuration for your deployments.
Setting Environment Variables
- Go to Project Settings → Environment Variables.
- Click "Add Variable".
- Enter the key and value.
- Choose the environment (Development, Preview, Production).
Accessing Variables in Code
Environment variables are available via process.env in Node.js or the appropriate method for your language.
const apiKey = process.env.API_KEY;
Security
- Variables are encrypted at rest.
- They are never exposed in client-side code unless prefixed with
NEXT_PUBLIC_(for Next.js) or similar framework conventions. - You can mark variables as "sensitive" to hide them in the UI.
Common Use Cases
- API keys (Stripe, Twilio, etc.)
- Database connection strings
- Feature flags
- Third-party service credentials