Environments and Variables

Reference values across multiple requests

GS

Written By Greg Schier

Last updated 19 days ago

When working with APIs, it’s common to reference the same values across many different types of requests. To make this easier, you can define things like API keys, ids, or domain names within an “Environment” and reference these values in (almost) any text input within Yaak.

Once defined, start typing the name of a variable or trigger the autocomplete menu using Ctrl+Space, then select the desired variable.

All variables will be rendered before the request is sent.

Global vs. Sub Environments

By default, each Yaak Workspace has a global environment. Variables defined here are always available no matter what.

Sometimes, however, it’s convenient to define multiple environments to switch between. The most common use-case for this is for declaring different values for development, staging, and production.

Once sub-environments are created, they can be activated from the dropdown menu in the application header. Note that variables within sub-environments are only available if the sub-environment is the active one.