Skip to content
Vegha VS Code

Environments & variables

An environment is a named set of variables, such as local, staging or prod, that {{variable}} placeholders resolve from.

  • Collection environments live in the collection’s environments/ folder and apply to that collection.
  • Workspace environments are shared by every collection in the workspace folder.
  • A collection can also use another collection’s environment, which helps when several collections call the same services.

The Environments view lists them. Its context menu has Set Active, Deactivate, Edit Environment, Duplicate…, Delete and Open as Text. Create one with New Environment…, or bring one in from Postman, Insomnia, Thunder Client or a .env file with Import Environment….

Select the environment name in the status bar or run Vegha: Select Environment…. Pick No Environment to send without one.

Environment files open in a visual editor: a filterable table of variables, each of which can be enabled or disabled and marked secret. Secret values are masked until you choose Show secrets. Changes save as you type.

  • {{variables}} in the request editor are coloured by whether they resolve (green), don’t (red), or are generated at send time (blue).
  • Hover over one to see its current value and where it comes from, and set it in the active environment from the hover.
  • Variables a chained request or a capture sets are recognised too, so a {{token}} set by your login request doesn’t show as undefined.
  • Vegha: Reset Session Variables clears the runtime values that scripts and captures set during this session.
  • Mark a variable secret to keep its value out of exports and out of AI tools. It shows to a model as «redacted».
  • A value like secret://my-vault/orders-api-key is resolved when the request is sent, through your configured secret managers (Azure Key Vault and AWS Secrets Manager). The secret-manager configuration is shared with the desktop app through the data directory.

Precedence rules and variable types are the same as in the desktop app. See Variable types and Secret managers.