Skip to content

Environments ​

An environment is a target for your requests, such as your local app, staging or production. Use environments to switch servers and to keep values such as tokens out of your requests.

Each environment has a name, a base URL and its own list of variables.

Kinds of environments ​

  • Current host is the default. It is the host Nimbus runs on and always exists. It uses the application base URL and cannot be disabled or deleted. It is the only environment that supports every feature.
  • Pre-configured environments come from config/nimbus.php. They are only usable when enabled is true. Their name and base URL are read only in the interface.
  • Custom environments are the ones you add on the UI. You can rename them, change the base URL and delete them.

Pre-configured environments apply to all applications. Each application keeps its own route prefix, so only the host changes when you switch.

Add pre-configured environments ​

php
'environments' => [
    'staging' => [
        'name' => 'Staging',
        'base_url' => 'https://staging.example.com',
        'enabled' => false,
    ],
],

An environment with 'enabled' => false is blocked. The server refuses to send a request to it and answers with a message, even when the browser switch is on. Set enabled to true to use it. A request that names an environment which is not in the config is refused too. Custom environments that you add in the browser are not affected.

The array key is the environment id. base_url is required and must be an absolute http or https URL. Do not list the local environment, because the current host is always added.

Note

This option is not related to allowed_envs, which controls where Nimbus itself can be opened.

Switch environments ​

  1. Open the environment menu in the top bar.
  2. Select an environment. Only enabled environments are listed.

Environment switcher

Requests go to the base URL of the active environment. The URL preview and the exported cURL command use it too. Open tabs keep their path.

What works only on the current host ​

  • Currently logged-in user, impersonation and token for user. Tabs that use them fall back to None when you switch away.
  • Cookie decryption. Cookies stay raw and Decrypt is disabled.
  • The special authentication injector.

Bearer, basic auth and manual headers work on every environment.

Manage environments ​

  1. Open the environment menu and select Manage environments.
  2. Select an environment in the list. Use its switch to enable or disable it. A pre-configured environment also needs enabled set to true in the config. The active one has an Active badge.
  3. Edit its variables. Each variable has a key, a value and an on or off switch.
  4. Click Add environment to create a custom one. The base URL must be an absolute http or https URL.

Environment page

Custom environments, variables and the enabled state are saved in your browser. They are not shared between Nimbus installations.

Use variables ​

Write {{ name }} to use a variable. Nimbus resolves it as you type.

A resolved variable

Variables work in these places.

PlaceWhere
EndpointThe whole endpoint bar.
AuthorizationBearer tokens, and the username and password of Basic Auth.
HeadersValues, not keys.
Query parametersValues, not keys.
Form rowsValues.
BodyThe full content of the JSON and Plain Text editors.

The color shows the state.

  • Grey means the variable exists and has a value.
  • Orange means the variable exists but its value is empty.
  • Red means the variable is not in the active environment.

Variable states

Type {{ to get suggestions. For values that change on every send, see Value generators and variables.