Environments and secrets
Workspace and global .env files, {{variables}}, # @extends, Keychain secrets, and the missing-variable guard.
An environment is a plain .env file. Requests reference its values as {{name}}.
Where environments live
- Workspace:
environments/NAME.envinside the collection folder. They go to git with the requests. - Global: shared across every workspace on this Mac.
Switch the active environment from the toolbar. ⌘⇧E opens Manage environments.
# environments/staging.env
# @extends base
baseUrl=https://staging.example.com
token=***secret***# @extends base loads base.env first, then applies this file's values on top.
Secrets stay out of git
Mark it secret
Tick the secret box for a variable in the environment editor.
Stored in Keychain
The value goes to the macOS Keychain. The file only holds ***secret***.
Commit safely
Teammates get the variable name, not your value. Each person sets their own.
Before an export, a fork, or an upload, Forge scans the collection for credentials and stops on what it finds. Move the value into a secret variable.
Missing-variable guard
Before sending, Forge checks every {{var}}. If one has no value, the send is blocked and the missing names are listed. A request that needs a secret you have not set stops before anything leaves your Mac.