<!-- https://testapilocally.com/docs/core-features/environments/ -->
# Environments & variables

* **Platform Availability:** Windows App · VS Code Extension (shared shell)
* **Overview:** Environments hold Variables and Secrets that resolve as `{{name}}` in URLs, headers, bodies, and scripts. Switch environments from the top bar without editing requests.

![Windows - Environment switcher](/docs/assets/screenshots/windows/windows-environment-switcher.png)

## How It Works (Windows App)

1. Open the environment switcher in the top bar.
2. Choose an environment (for example **httpbingo** from the Starter Guide).
3. Click manage / open **Environments** to edit Variables vs Secrets tabs.
4. Import or export environment files as needed.

![Windows - Environments page](/docs/assets/screenshots/windows/windows-environments-page.png)

## How It Works (VS Code Extension)

1. Same switcher and Environments page inside the SignOff Studio webview.
2. Secrets stay local; do not commit secret values — they are stripped from workspace files intended for Git.

![VS Code - Environments](/docs/assets/screenshots/vscode/vscode-environments-page.png)

## Code / Configuration Examples

```json
{
  "name": "httpbingo",
  "variables": [
    { "key": "baseUrl", "value": "https://httpbingo.org" },
    { "key": "token", "value": "", "secret": true }
  ]
}
```

In a request URL:

```text
{{baseUrl}}/bearer
```

In a header:

```text
Authorization: Bearer {{token}}
```

In a script:

```javascript
const base = qa.variables.get("baseUrl");
qa.log(base);
```

## Edge Cases, Troubleshooting & Pro-Tips

- If Send shows literal `{{baseUrl}}`, no active environment (or missing key).
- Prefer Secrets tab for tokens and passwords.
- Starter env file: [signoff-studio-starter.httpbingo.signoff.env.json](../assets/signoff-studio-starter.httpbingo.signoff.env.json)

## Next

- [Authentication](/docs/core-features/authentication/)
- [Workspaces](/docs/core-features/workspaces/)
