Skip to content
>devspeak
← glossary
level 1Understanding Your Project

Environment variable

also: environment variables, env var, env vars

A named setting given to your app by the environment it runs in, rather than written in the code. Each environment can supply a different value.

a bit more technical

A named value, such as DATABASE_URL, supplied to a running program by the operating system or hosting platform. It's the standard way to pass configuration and secrets per environment, and is often loaded locally from a .env file.

picture it

Think of a note left at a reception desk for each shift. The instructions say "call the number on the note". The instructions never change, but each shift leaves its own number.

why it matters

Agents use environment variables for things like database addresses and API keys. If one is missing in production, the app can break even though the code is identical to what worked on your laptop.

what your agent might say
agent
The deploy failed because DATABASE_URL isn't set in production. Add it in your hosting dashboard's environment variables and redeploy.
how you might use it
you → your agent
Read the email service key from an environment variable, not the code. List every environment variable I'll need to set in production.
common mistake

Thinking that setting a value on your laptop, for example in a .env settings file, also sets it in production. Each environment needs its own values set separately.