diff --git a/variables/global-environment-variables.mdx b/variables/global-environment-variables.mdx index 2df6ae53..36a7a3f4 100644 --- a/variables/global-environment-variables.mdx +++ b/variables/global-environment-variables.mdx @@ -78,6 +78,18 @@ To use a global environment variable, reference it using the format `{{var_name} ![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: diff --git a/variables/process-env.mdx b/variables/process-env.mdx index d5e96907..707bb3d0 100644 --- a/variables/process-env.mdx +++ b/variables/process-env.mdx @@ -47,3 +47,7 @@ You can use `process.env.` throughout your Bruno collection to secu 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. + +### 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.