Environment Variables
Environment variables let you pass configuration to your app at runtime without hardcoding values in your code.
Adding variables
- Go to your environment’s detail page
- Click the Configuration tab
- Under Environment variables, click Add variable
- Enter the key and value
- Optionally mark it as secret — secret values are encrypted at rest and masked in the UI
Secret variables
Secret variables are encrypted before being stored. Once saved:
- The value is masked in the UI (shown as
••••••••) - It cannot be read back — only overwritten or deleted
- It is still injected into your app as a plain environment variable at runtime
Use secrets for sensitive values like database passwords, API keys, and tokens.
Applying changes
Environment variable changes take effect on the next deployment. After adding or updating variables, trigger a new deployment to apply them.
Accessing variables in your app
Variables are injected as standard environment variables. Access them using your language’s standard method:
Node.js:
const dbUrl = process.env.DATABASE_URL;
Python:
import os
db_url = os.getenv("DATABASE_URL")
Go:
dbUrl := os.Getenv("DATABASE_URL")