Skip to main content
Secrets are accessed in the same way as collection and environment variables in headers, query params, body, and auth fields.
v4 syntax change:
  • The recommended syntax is now {{secret-name.key-name}} (e.g. {{dbCredentials.password}}).
  • The old {{$secrets.secret-name.key-name}} syntax still works in v4 but is deprecated and it is shown with an underline in the editor and will be removed in the next major release.
Recommended syntax (v4+):
For example, if you have a secret named dbCredentials with a key password, reference it as {{dbCredentials.password}}. Legacy syntax (deprecated):
For example: {{$secrets.dbCredentials.password}}

Using Secrets in Scripts

You can also access secrets from within Pre-request and Post-request scripts using the bru.getSecretVar() function.
This approach keeps your sensitive data secure while allowing you to leverage AWS Secrets Manager secrets in your API automation scripts.

Using Secrets with Bruno CLI

To learn more about using secrets with Bruno CLI, please refer to CLI Documentation.