Environment variables
Functions read configuration from process.env (JavaScript/TypeScript) or os.environ
(Python). You can set variables per-environment from the CLI or the dashboard.
Setting a variable
Section titled “Setting a variable”nimbus env set STRIPE_KEY sk_live_••••••••• --env productionGo to Project → Settings → Environment Variables, choose an environment, and add a key/value pair.
Reading it in a function
Section titled “Reading it in a function”export default function handler(request: Request) { const key = process.env.STRIPE_KEY; // ...}Environments
Section titled “Environments”Nimbus has three built-in environments, each with its own variable set:
| Environment | Triggered by |
|---|---|
preview |
nimbus dev |
staging |
nimbus deploy --env staging |
production |
nimbus deploy --env production |