Environments
An environment is a named set of variables, such as local, staging or production. Requests use them as {{name}}, so the same request works against every environment.
Where environments live
Section titled “Where environments live”Courier uses the JetBrains HTTP Client files at the root of the workspace:
{ "$shared": { "apiVersion": "v1" }, "local": { "baseUrl": "http://localhost:3000" }, "staging": { "baseUrl": "https://staging.example.com" }}{ "staging": { "token": "…" }}http-client.env.jsonis shared with your team in git.http-client.private.env.jsonholds secrets and stays out of git. Values here override the public file.$sharedholds globals that every environment gets.
Edit environments
Section titled “Edit environments”Press ⌘E to open the environment editor. From there you can:
- add, rename, duplicate and delete environments and variables,
- mark a value as secret, which moves it to the private file, or move it back to the public file,
- edit the files as raw JSON,
- Import a .env file,
- see which variables no request uses,
- right-click a variable → Move values to the keychain, which stores the values in the macOS keychain and keeps only references in the file. See Secrets.
The Runtime section lists values set by scripts with client.global.set. They last until you close the folder.
Switch environments
Section titled “Switch environments”- Pick one from the environment menu in the title bar.
- Press ⌘1 to ⌘9 for the first nine environments, and ⌘0 for none.
- Type
env:in the command palette.
Use variables
Section titled “Use variables”Type {{ in any field to list variables. Hover a variable to see its value. A variable with no value is highlighted in red.
Where a value comes from
Section titled “Where a value comes from”When the same name is set in several places, the later one in this list wins:
$sharedin the env files- The selected environment (private file over public file)
- Folder variables
- In the runner and CLI: data-file rows and
--varvalues
Values from scripts (client.global) fill {{variables}} that the environment doesn’t set.