Skip to content

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.

Terminal window
nimbus env set STRIPE_KEY sk_live_••••••••• --env production
functions/charge.ts
export default function handler(request: Request) {
const key = process.env.STRIPE_KEY;
// ...
}

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