Skip to main content
Environment variables are variables that are scoped to an environment, such as local development or production. They are useful for storing variables that can be re-used across the collection that are different depending on the environment. An example would be the host url of the server you want to test.

Creating an Environment Variable

  1. Go to environments (top right) and press No environment.
  2. If there are no environments, you will be prompted to create one.
No-Environment
  1. Add your variable name and value for the specific environment.
  2. Save your changes.
No-Environment

Using an Environment Variable

Just like other variables you can use the {{varName}} syntax to use an environment variable in a request. On the top-right, you can see which environment you are currently using and select a different one. Environment Variables location

Searching environment variables

When working with a large number of environment variables, you can use the search feature to quickly find specific variables.
  1. Open your environment settings.
  2. Click the search icon in the environment details panel.
  3. Type your query to filter variables by name or value.
The search filters the variable list in real time. If you click on a variable row while searching, that row stays visible even if it no longer matches the query, so you can edit it without losing your place. The row unpins automatically after a short delay.
The search feature is also available for global environment variables.

Using the ./environment directory

Environment variables are synced with the /environments directory inside your collection. You can also create and manage environments there. Each environment is saved in a <environment-name>.bru file, which looks like this:
vars {
  host: http://localhost:8787
}
For information on importing and exporting environment variables, see the Import/Export Environments guide.