Environment variables
Environment variables store configuration and secrets your app reads at runtime — database URLs, API keys, feature flags, and more. They’re part of the app’s configuration and can be changed without a full redeploy.
How they’re stored
Section titled “How they’re stored”Environment variables live in an app’s env array — a list of { name, value } pairs:
{ "env": [ { "name": "DATABASE_URL", "value": "postgres://user:pass@host:5432/db" }, { "name": "DEBUG", "value": "true" } ]}Set or update a variable
Section titled “Set or update a variable”From the dashboard, edit the app’s Environment variables. From the API, include the full
env array in a PUT /apps call (updates replace the whole config, so include every variable
you want to keep):
curl -X PUT https://api.cumin.dev/apps \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "id": "<app-id>", "project_id": "…", "name": "my-api", "image": "docker.io/nginx:latest", "ports": [{ "name": "web", "number": 80 }], "env": [ { "name": "DATABASE_URL", "value": "postgres://user:pass@host:5432/db" }, { "name": "DEBUG", "value": "true" } ], "cpu": 256, "memory": 512, "instances": 1, "hibernated": false }'Setting a key that already exists overwrites its value. Remove a variable by omitting it from
the env array.
Using them in your app
Section titled “Using them in your app”Read them the standard way for your language:
import osDATABASE_URL = os.environ["DATABASE_URL"]const dbUrl = process.env.DATABASE_URL;Secrets vs. environment variables
Section titled “Secrets vs. environment variables”Environment variables are visible in the app’s configuration. For anything that must stay encrypted and out of config listings — API keys, signing secrets, database passwords — store it in Secrets instead.
Next steps
Section titled “Next steps”- Secrets — encrypted, write-only values
- Configuration — other live-config options
- Apps API reference — the
envfield andEnvVarobject