Environments

Environments in JetClient let you define variable sets for different contexts, such as Local, Staging, or Production.
Each project has its own environments, which are configured in the Environments tab, while their corresponding variables are managed in the Variables tab.

Environment Groups

Unlike other API clients, JetClient allows you to activate multiple environments simultaneously using Environment Groups.
This feature lets you select one environment from each group, combining variables from different contexts.

  • The Default group is always available and typically includes environments like Local, Staging, Production, and others.
  • You can create custom groups to suit your needs, such as User, Client, Tenant, Region, API Version, and more.

Managing Environments

To create environments and groups in the Environments tab:

  1. Open the Environments tab in the project folder, or click Manage Environments in the active environment dropdown.
  2. Click the Plus button and select New Environment or New Group.
  3. Provide the following details:
    • Name: Environment or group name.
    • Alias: Optional identifier (auto-generated if not specified).

Using Aliases

  • Environment Group Alias: Reference the active environment for a specific group in scripts.
    Example:
    jc.environment.set('var', 'value', 'envGroupAlias') sets the variable var to value for the active environment in the specified group.

  • Environment Alias: Use aliases as top-level properties in the Variables JSON to associate variables with specific environments.

Selecting Active Environments

The active environment dropdown is available in the top-right corner of request, folder, and script editors.
Select one environment per group, or choose No Environment if needed. The selected environments determine which variables are available during execution.