Variables
Overview
Variables in the Bruno allow you to store dynamic values that can be reused across multiple API requests, environments, and workflows. This feature enhances flexibility, maintainability, and efficiency by enabling you to manage frequently changing data points such as tokens, environment-specific URLs, or user-defined values in one place.
Types
There are 7 types of variables you can create:
- Global Environments Variables
- Environment Variables
- Collection Variables
- Folder Variables
- Request Variables
- Runtime Variables
- Prompt Variables
Additionally, Process Environment Variables can be defined in an external environment configuration file:
Variable Precedence and Scope
When a variable is accessed, the following precedence is used to determine which value is used:
- Runtime variables get the highest precedence.
- Prompt Variables are defined using the
{{?Prompt String}}syntax and hence don’t compete with the above. - Process Environment Variables are accessed using the
{{process.env.VAR_NAME}}syntax and hence don’t compete with the above.
Variable Storage
Each variable has its own storage location either within your collection file or within the app’s memory. All storage is local.
| Variable Type | Storage Location |
|---|---|
| Collection | <collection-name>.bru |
| Folder | <folder-name>.bru |
| Request | <request-name>.bru |
| Environment | <env-name>.bru |
| Runtime | Local storage |
| Global | Local storage |
| Prompt | Never stored |
| Process Environment | Separate .env file |
Environment Color Coding
Environment color coding is now available (v3.1.0+) for Environment Variables and Global Environment Variables, making it easier to visually identify and distinguish between different environments.
Bruno allows you to customize the visual appearance of your environments using color coding. This feature helps you quickly identify which environment you’re currently working with, reducing the risk of accidentally running requests against the wrong environment.
Color Customization
You can assign a custom color to each environment:
- Navigate to environment settings (top right corner)
- Click the brush icon next to the environment and select a color from the color picker component
- If no color is selected, a default color will be assigned
![]()
Color-Coded Visual Indicators
Once colors are assigned, they appear in multiple places throughout the interface:
Environment Selector Dropdown: A small color swatch is displayed next to each environment name, making it easy to distinguish between environments at a glance.
Active Environment Indicator: The currently selected environment’s color is prominently displayed in the environment pill in the tabs UI, providing constant visual feedback about which environment you’re working with.

This visual system helps prevent mistakes when switching between development, staging, and production environments, especially in fast-paced workflows.
Variable Data Type
All variables are stored as strings. Bruno does not infer or change the data type of the variable based on the value you set.
Debugging Variables in Console
You can access and debug variables in the console using the following pattern:
The pattern follows bru.get[Type]Var(key) where:
[Type]is the variable type (Runtime, Request, Folder, etc.)keyis the variable name you want to access
Example:
// Basic syntax: console.log(bru.get[Type]Var(key))
console.log(bru.getVar('myVar')) // Runtime variablesScripting API
Please see the Scripting API for more information on how to access variables in your scripts.
Prompt variables are not accessible via the Scripting API.