Documentation

Managing Environments and Variables

Environments and variables let you store reusable values—such as API keys, base URLs, or authentication tokens—and swap them across different configurations.

Environments

An environment is a named set of key-value pairs representing a specific deployment stage, such as Local, Development, or Production.

  • Create and Manage: Switch to the Environment tab in the sidebar to manage your sets. Click the + button to create a new environment.
  • Switching: Select the checkbox next to an environment in the sidebar to activate it. You can also switch environments using the dropdown menu on the right side of the tab bar.

Variables

Variables are placeholders that PostPilot resolves to their assigned values before sending a request or executing a query.

Creating variables

  • Manual Entry: Click an environment in the sidebar to open its editor, then add your keys and values.
  • Extract from Results: In the Data Inspector or any query result row, click the Options (...) menu and select Extract to variable. Enter a name; the query result is automatically assigned to this variable on every execution.
  • Inline Creation: Enter an undefined variable (e.g., {{myVar}}) in any supported field. The app triggers a popup allowing you to input a value and create the variable immediately.

Using variables

Use the {{variableName}} syntax to reference variables.

Supported fields:

  • API Client: URL, Auth helpers, Header values, Parameter values, and Request Body (Raw, Form Data, or URL-encoded).
  • Database Client: SQL and NoSQL queries.

Note: Variable resolution is supported in values only; it is not supported in Header or Parameter keys.

Autocomplete and Behavior

  • Autocomplete: Type {{ in any supported field to see available variables.
  • Resolution: Variables are resolved from the currently active environment.
  • Undefined Variables: If a variable is missing or invalid, it renders as literal text (e.g., {{name}}) and is sent as a raw string. Clicking an undefined variable in the UI opens the creation popup.