Settings outside the app’s code
Each variable pairs a name with a value, such as the address of a database. An app can read that value without storing it in its code. A testing copy might use a test database, while the production copy uses a live one.
Each running copy of the app gets its own values, whether on a developer’s computer or a server. Changing those values does not change the shared code.
Treat sensitive values carefully
Environment variables can appear in diagnostic tools, crash reports, or logs. Keep sensitive values in a protected secret store and make them available only to the app that needs them.
Environment variables hold text, so the app should check that required values are present and correctly formatted when it starts.