<!-- https://qasignoff.com/docs/core-features/environments/ -->
# Environments & variables

* **Platform Availability:** Windows App · VS Code Extension
* **Overview:** An environment is a named set of values, such as a base URL and a token. Use a value anywhere as `{{name}}`, then switch environments to run the same request against local, QA or staging.

## Switch environments

Open the environment menu in the top bar and choose one. With **None** selected, only variables from other scopes, such as collection variables, can resolve.

![Environment menu with httpbingo selected](/docs/assets/screenshots/app/environment-switcher.webp)

Choose **Configure environments** to add, import or edit environments.

![Environments page with variables, filters and the QA / Integration colour grade](/docs/assets/screenshots/app/environments-page.webp)

## Mark risky environments with a colour

Click the badge next to the environment name to choose a colour grade.

| Grade | Use it for |
|-------|------------|
| Red | Production. Also shows a warning banner |
| Amber | Staging or load testing |
| Green | Local or safe |
| Blue | QA or integration |
| None | No marker |

![Colour grade menu with Red, Amber, Green and Blue](/docs/assets/screenshots/app/environment-colour-grades.webp)

The colour appears as a dot in the environment list and top-bar menu, and as a line at the top of the Environments page. It is saved with the environment, so teammates who share the workspace see it too. It is only a visual marker and does not block requests.

## See and edit a variable in place

Hover over any `{{variable}}` in the URL, params, headers, auth, form fields, body or scripts. The card shows its value, its scope and where it comes from. Click **Edit**, change the value and press **Enter**.

![Variable card for baseUrl showing its value and environment](/docs/assets/screenshots/app/variable-hover-card.webp)

- Secret values stay hidden until you reveal them.
- An undefined variable is marked, and you can create it from the same card.

## Autocomplete variables

Type `{{` wherever variables work, including request bodies and scripts. The list shows each variable's scope and value, with recently used variables first. Keep typing to filter by name or value, then press **Enter** to insert one. Secret values stay masked.

![Autocomplete list of variables matching "user"](/docs/assets/screenshots/app/variable-autocomplete.webp)

## Find and review variables

Press **Ctrl+F** on the Environments page to search by name, value or description. Masked secret values are never searched. The search box above the environment list also finds environments by variable name.

| Filter | Shows |
|--------|-------|
| All | Every variable |
| Same Value | Variables that share a value |
| Same Description | Variables that share a description |
| Secret Values | Variables marked as secret |
| Drifted | Variables whose value changed during a run |

Two enabled variables with the same name are marked `Dup name`.

## Baseline and run-time values

Scripts can change a variable while requests run. Its original value is kept as the **baseline**, and the variable is marked **Drifted**. You can then:

- revert it to its baseline;
- keep the new value as the baseline; or
- use **Reset All…** to restore every baseline or clear every value. You have to type `reset` to confirm.

Clearing all values clears the baselines as well. Editing a value in the table also updates its baseline.

## Secrets and sharing

- Mark tokens and passwords as secret. Their values are removed from workspace files meant for Git, and hidden in script logs, history and reports. Requests and scripts can still use them.
- **Show Secret Values** reveals every secret for 15 seconds, then hides them again.
- **Share** copies the environment as SignOff JSON or `.env`. By default it redacts secrets and uses baseline values.
- **Auto-Describe Empty** fills in blank descriptions from the variable names. It works offline and leaves existing descriptions alone.

## Examples

```text
URL:    {{baseUrl}}/bearer
Header: Authorization: Bearer {{bearerToken}}
```

In a script:

```javascript
const base = qa.variables.get("baseUrl");
qa.log(base);
```

To try this with sample data, download the [starter environment](../assets/signoff-studio-starter.httpbingo.signoff.env.json), then use **Import → Environments**.

![Import window on the Environments tab](/docs/assets/screenshots/app/import-environments.webp)

## Which value is used?

If a name exists in more than one scope, SignOff Studio uses the first match in this order:

1. Runtime
2. Session
3. Data file
4. Secret
5. Environment
6. Collection
7. Global
8. System

Imported scripts can change how long a value lasts, to match the tool they came from. See [Tests & scripts](/docs/core-features/tests-scripts/).

## Troubleshooting

- **A variable is marked as unresolved:** check the selected environment, then hover over the variable to create or fix it.
- **The value isn't what you expect:** the hover card shows which scope it comes from.

## Next

- [Requests](/docs/core-features/requests/)
- [Authentication](/docs/core-features/authentication/)
- [Workspaces](/docs/core-features/workspaces/)
