Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions variables/global-environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@

![Environment Variables location](/images/screenshots/variables/env-action.webp)

### Using process.env in global environments

You can reference process environment variables inside global environment variable values using the `{{process.env.VAR_NAME}}` syntax. Bruno resolves these references from the workspace-level `.env` file, so your secrets remain out of version control while still being usable in global environments.

For example, you can set a global environment variable value to:

```text
{{process.env.API_KEY}}
```

When the global environment is active, Bruno will resolve the value from the workspace `.env` file. See [Process Environment Variables](/variables/process-env) and [DotEnv File](/secrets-management/dotenv-file) for more details on managing `.env` files.

## Selecting a Global Environment

To activate a global environment:
Expand All @@ -96,7 +108,7 @@

If you have existing global environments in Bruno 2.x:

1. **Default Workspace** - Bruno will migrate your existing global environments to the Default Workspace's `environments/` folder

Check warning on line 111 in variables/global-environment-variables.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

variables/global-environment-variables.mdx#L111

Did you really mean 'Workspace's'?
2. **Custom Workspaces** - You will need to manually recreate or import global environments for any new custom workspaces you create
3. **Export/Import** - You can export environments from one workspace and import them into another

Expand Down
4 changes: 4 additions & 0 deletions variables/process-env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@
![image](/images/screenshots/variables/using-process-env-variables.webp)

<Info>
Starting from Bruno **v3.1.0**, you can create and manage `.env` files directly inside Bruno at workspace level. Check the [Secret Management - Dotenv File](/secrets-management/dotenv-file) section for more details.

Check warning on line 48 in variables/process-env.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

variables/process-env.mdx#L48

Did you really mean 'Dotenv'?
</Info>

### Using process.env in global environments

Process environment variables can also be referenced inside [global environment variable](/variables/global-environment-variables) values. Bruno resolves `{{process.env.VAR_NAME}}` references from the workspace-level `.env` file, allowing you to use secrets in global environments without exposing them in version control.