Promptles
Automation & Scripting

Environment Variable

beginner

Definition

A named value set outside your code that programs can read at runtime. They're used for configuration that changes between environments, like API keys, database URLs, or feature flags, so you don't hardcode secrets into your source code.

In the wild

DATABASE_URL=postgres://localhost:5432/myapp tells your app where the database is. In development it points to localhost; in production it points to a cloud server. The code reads process.env.DATABASE_URL and works in both places.

More from Automation & Scripting