Guides
Environment variables
Configure an instance without committing secrets.
Add a secret
For an app you have already deployed:
hub app my-app env set API_KEYPaste the value at the hidden prompt. Hub saves it and creates a release to apply the change.
hub app my-app statusImport a .env file
hub app my-app env set --file .envKeep this file out of source control. Saved values are encrypted and are not shown in variable listings.
Configure a frontend build
hub app my-app env set --build VITE_API_URL=https://api.example.comHub rebuilds the app. Frontend build values can appear in the published files, so use them only for public configuration.
Variables belong to one instance. In Compose, pass them to services using ${NAME}; see the database example.