Skip to content

Environment variables

Environment variables store configuration and secrets your app reads at runtime — database URLs, API keys, feature flags, and more. gy manages them without requiring a redeploy.

Terminal window
gy config set env DATABASE_URL=postgres://user:pass@host:5432/db
gy config set env DEBUG=true

Setting an existing key overwrites its value:

Terminal window
gy config set env DEBUG=false
Terminal window
gy config unset env DEBUG
Terminal window
gy config sync

Read them the standard way for your language:

import os
DATABASE_URL = os.environ["DATABASE_URL"]
const dbUrl = process.env.DATABASE_URL;

Variables are stored in your project’s .gy.json under env:

{
"env": {
"DATABASE_URL": "postgres://…",
"API_KEY": "…"
}
}