Skip to content

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.

Courier uses the JetBrains HTTP Client files at the root of the workspace:

http-client.env.json
{
"$shared": { "apiVersion": "v1" },
"local": { "baseUrl": "http://localhost:3000" },
"staging": { "baseUrl": "https://staging.example.com" }
}
http-client.private.env.json
{
"staging": { "token": "…" }
}
  • http-client.env.json is shared with your team in git.
  • http-client.private.env.json holds secrets and stays out of git. Values here override the public file.
  • $shared holds globals that every environment gets.

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.

  • 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.

Type {{ in any field to list variables. Hover a variable to see its value. A variable with no value is highlighted in red.

When the same name is set in several places, the later one in this list wins:

  1. $shared in the env files
  2. The selected environment (private file over public file)
  3. Folder variables
  4. In the runner and CLI: data-file rows and --var values

Values from scripts (client.global) fill {{variables}} that the environment doesn’t set.