> ## Documentation Index
> Fetch the complete documentation index at: https://bruno-a6972042-docs-timeline-scripts.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

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

* Go to environments (top right) and press **No environment**.

<img src="https://mintcdn.com/bruno-a6972042-docs-timeline-scripts/qLeHtpKFpf3RFoq7/v2/images/screenshots/variables/no-environment.webp?fit=max&auto=format&n=qLeHtpKFpf3RFoq7&q=85&s=1aa9f9b48e963800c1f861e512d8e50b" alt="No-Environment" width="2684" height="1410" data-path="v2/images/screenshots/variables/no-environment.webp" />

* If there are no environments, you will be prompted to create one.

<img src="https://mintcdn.com/bruno-a6972042-docs-timeline-scripts/qLeHtpKFpf3RFoq7/v2/images/screenshots/variables/collection-environment.webp?fit=max&auto=format&n=qLeHtpKFpf3RFoq7&q=85&s=f769bbff5b5f1209748378c98635241e" alt="No-Environment" width="2684" height="1410" data-path="v2/images/screenshots/variables/collection-environment.webp" />

* Add your variable name and value for the specific environment.
* Save your changes.

<img src="https://mintcdn.com/bruno-a6972042-docs-timeline-scripts/qLeHtpKFpf3RFoq7/v2/images/screenshots/variables/environment-variables.webp?fit=max&auto=format&n=qLeHtpKFpf3RFoq7&q=85&s=136dbbe70d46ace3837f49c0f53d13e5" alt="Environment Variables location" width="2760" height="1070" data-path="v2/images/screenshots/variables/environment-variables.webp" />

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

## 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:

```bash local.bru theme={null}
vars {
  host: http://localhost:8787
}
```

<Info>
  For information on importing and exporting environment variables, see the [Import/Export Environments](/get-started/import-export-data/import-export-environments) guide.
</Info>
