Skip to content

Environments & Variables

Environments are named sets of key-value variables scoped to a project. Switching the active environment changes the values injected into all probes and chains without modifying any probe configuration. This lets you reuse the same probes against different targets (e.g. dev, staging, prod).

Environments belong to a project rather than a bundle. Open the project dashboard (click the project chip in the app bar, then Project Dashboard) to manage its environments. The environment editor is the main (left) panel of the dashboard; the linked bundles, probes, chains and scripts sit in the panel on the right.

The active project and its active environment are always visible in the app bar:

App bar showing active project chip and environment chip

In the project dashboard, type a name in the environment name input at the top of the editor (e.g. dev, staging) and click the + button. Each environment becomes a tab. Clicking a tab opens that environment for editing.

The environment editor: a tab per environment and the variable name/value table

With an environment tab selected, its actions appear in the action toolbar at the top of the app:

ActionEffect
SavePersists the environment’s variables
CloneDuplicates the environment as … (copy)
RenameRenames the selected environment
DeleteRemoves it (with a confirmation prompt)
ExportDownloads it as a standard environment file (<name>.environment.json)
ImportAdds an environment from a file (see below)

A variable is only used by probes, chains and scripts after the environment is saved. Until then it lives in the editor and nowhere else, so a probe with {{baseUrl}} in its URL would send the placeholder as written and fail.

The editor marks unsaved changes with a dot on the environment tab and shows a warning. A send that still contains an unresolved placeholder says so by name instead of reporting an invalid URL.

Add key-value pairs to the environment. Variable names are case-sensitive.

A variable name can contain only unaccented letters (a-z, A-Z), digits and underscores, because a placeholder such as {{order.id}} or {{api-key}} is never replaced in a request. The editor marks a name like that as you type it and will not save the environment until it is renamed. The same rule applies to credential bindings, to every variable name in a chain step and to skill inputs and outputs.

KeyValue
hostapi.dev.example.com
tokendev-secret-token
email[email protected]

Variable table with several rows, edit and delete icons per row

Reference a variable anywhere a text field is supported using double curly braces:

https://{{host}}/api/users
Authorization: Bearer {{token}}

If a placeholder is not being replaced, check for a space, a dot or a hyphen inside the braces before you check anything else.

The spaces are the one that catches people, because it looks right:

WrittenReplaced
{{baseUrl}}yes
{{ baseUrl }}no
{{order.id}}no
{{order-id}}no
{{order_id}}yes

{{ baseUrl }} and {{baseUrl}} are not the same thing. The spaces are part of the placeholder, so the first one is left exactly as you typed it.

VirtuProbe now tells you while you are editing, quoting the placeholder as written and naming the character that stops it working. Previously the request went out with the text still in it and the problem surfaced somewhere else entirely, usually as a complaint that the address was not valid, with nothing pointing back at the variable.

Supported fields per probe type:

ProbeFields
HTTPURL, body, headers, query parameters, cookies
SMTPHost, each command’s data
IMAPHost, each command’s data
LDAPHost, DN, password, filter, attribute, value
DNSResolver host, query name
SpamAssassinHost, message body
SMBHost, domain, username, password, NT hash, each command’s paths and arguments
KerberosHost, realm, username, password, SPN
MySQLHost, database, query
PostgreSQLHost, database, query
SQL ServerHost, database, instance, query
MongoDBHost, database, collection, filter, document, pipeline, command, connection string
RedisHost, key, value, key pattern, each command’s arguments
ActiveMQHost, virtual host, destination, message body, each frame’s headers
FTPHost, remote path, upload content, each command
FreestyleHost, each exchange’s payload and expected text, the read delimiter

Click the environment chip in the app bar to open the environment picker for the active project. Click any environment to activate it in one step. To deactivate all environments, choose No environment at the top of the list.

Environment picker menu: No environment and available environments

The active environment per project is stored locally and persists across sessions, so it is restored automatically the next time you open the app or switch back to that project.

If a probe defines its own inline variables with the same name as an environment variable, the probe’s inline variable wins.

An environment can carry credential bindings next to its variables. A binding maps a name to one of your stored credentials without copying it into the environment. You choose that name in a probe’s credential picker, so switching the active environment swaps the whole credential (scheme, configuration and secrets) without touching the probe.

For example, a payments API takes a Bearer token in dev and Basic authentication in staging. One probe covers both, because it sends whichever credential the active environment binds:

  1. Create the two credentials, for example Payments API token with the Bearer scheme and Payments API key (Basic) with the Basic scheme.
  2. In the Project Dashboard select the dev tab and open the Credential bindings card below the variables. Click Add binding, name it payments (a binding name takes the same characters as a variable name), pick Payments API token and click Save.
  3. Select the staging tab, add a payments binding that points at Payments API key (Basic) and click Save.
  4. In the probe’s credential picker choose payments under Environment bindings. The probe stores it as {{payments}}.

The Credential bindings card of the dev environment, binding payments to the Payments API token

The credential picker open, with an Environment bindings group above the stored credentials

Under the picker the effective-credential summary names the credential the binding points at in the active environment, with env binding as its source. Switching the environment chip from dev to staging changes the credential the summary names from Payments API token to Payments API key (Basic) before you send anything.

The effective credential summary with env binding as its source

Bindings work in every probe editor with a credential picker (HTTP, SMTP, IMAP, LDAP, MySQL, PostgreSQL, MongoDB, SQL Server and ActiveMQ), in chain steps and in a script’s vp.send.

A probe whose binding the active environment does not define is not sent. The send stops with an error that names the missing binding, for example Nothing was sent. The active environment does not bind {{payments}} to a credential. A binding that points at a deleted credential is refused the same way. The HTTP credential picker warns about both cases as soon as you open the probe.

In a chain the step fails with an error naming the binding, as does a script’s vp.send. The probe is never sent with a different credential or with none in its place.

A bundle or probe export keeps the binding name, so a probe set to {{payments}} still reads {{payments}} after an import into another workspace and works there as soon as the active environment binds that name. The credential itself stays in the workspace it was created in, with every secret.

An environment export (below) contains the variables only, because the standard environment file has no place for a binding. Re-create the bindings after importing it, or copy them across from another environment of the same project with Compare environments.

In a directory-backed workspace each binding is saved in the environment’s file as a binding name and a credential id. Both stay readable even when you encrypt environment values, because neither is a secret.

Use Export (in the action toolbar with an environment selected) to download the environment as a standard environment file. The file uses the common environment schema, so it imports into other request tools as well as back into VirtuProbe.

Use Import to add an environment from a file. Supported formats:

  • A standard environment export (.json)
  • A dotenv file (.env) of KEY=value lines
  • A Bruno environment file

The imported environment is created in the active project and selected automatically.

A name another tool accepts but VirtuProbe would never replace is renamed on import (api-key becomes api_key) and the import lists every rename. If two names would end up the same (api-key and api.key), or a name has no letter or digit to keep, nothing is imported and the error names the problem, so you can rename it in the file.

Once a project has two or more environments, the Compare environments action in the toolbar opens a side-by-side diff. Pick two environments and VirtuProbe shows, for both variables and credential bindings, which entries exist only on one side, which differ and which match (identical rows are hidden until you ask for them).

From the diff you can copy an entry either direction, or copy every missing entry at once. That is a quick way to bring a new environment up to date with an existing one, or to reconcile two that have drifted apart. Copies are held until you choose Save changes, which writes both environments.

A chain resolves variables when it runs, using the active project’s environment. Variables produced by extractors in earlier steps take precedence over environment variables of the same name.