> ## Documentation Index
> Fetch the complete documentation index at: https://bruno-a6972042-api-docs-release.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Interactive Playground

The generated documentation is executable, not just readable. Every request has a **Try** button that opens an interactive playground, plus ready-to-copy code samples.

## Try Requests Live

Click **Try** on a request to open the playground. From there you can:

* Edit parameters, headers, and body
* Run the request live from the documentation
* See the response immediately
* Inspect and edit the scripts that belong to that request

<img src="https://mintcdn.com/bruno-a6972042-api-docs-release/WAuMiLKSjUC6iuIu/images/screenshots/v4/collection-docs/play-ground.webp?fit=max&auto=format&n=WAuMiLKSjUC6iuIu&q=85&s=9017a704e94a0a1e385291aa1191c38a" alt="Try It Out Playground" width="2826" height="1610" data-path="images/screenshots/v4/collection-docs/play-ground.webp" />

## Scripting in the playground

When you hit **Try**, Bruno runs the same collection scripts the desktop app would run: pre-request, post-response, and tests. Collection, folder, and request scripts still stack in that order.

The playground runs those scripts in a browser sandbox that matches **[Safe Mode](/get-started/javascript-sandbox)** in the desktop app. `bru`, `req`, and `res` are the same objects you already use in collection scripts. If a script works in Safe Mode on your machine, it should behave the same way here.

That includes:

* Environment, global environment, and runtime variables (`bru.getEnvVar`, `bru.setVar`, and related helpers)
* Collection, folder, and request variables (`bru.getCollectionVar`, `bru.getFolderVar`, `bru.getRequestVar`)
* Secrets resolved at run time with `bru.getSecretVar`
* `bru.interpolate` (this is a real interpolation, not a no-op)
* `bru.sleep`, `bru.sendRequest`, and `bru.utils`
* Flow control such as `bru.setNextRequest`
* The Safe Mode `req` and `res` accessors (URL, method, headers, body, status, and so on)

```js theme={null}
const region = bru.getRequestVar("region");
const baseId = bru.getCollectionVar("baseId");
const apiKey = bru.getSecretVar("API_KEY");

bru.setNextRequest("Refresh Token");
```

The full method list lives in the [JavaScript reference](/testing/script/javascript-reference). Treat that page as the Safe Mode contract. The playground follows it, except for the APIs called out below.

<Info>
  Secret values are resolved when a reader runs a request. They are not written
  into the generated HTML as plaintext. Keep using secret variables the way you
  already do in the collection.
</Info>

### What the playground cannot run

A few APIs need the desktop app and are not available in the browser sandbox. Developer Mode features (filesystem access, system commands, extra npm packages) are also out of reach here.

If a script calls one of the deferred APIs, the playground does not fail silently. It shows a warning in the response pane, naming the API:

```text theme={null}
<api> is not currently supported in the Bruno playground. Please use the Bruno desktop app.
```

For example: `bru.visualize is not currently supported in the Bruno playground. Please use the Bruno desktop app.`

| API                                                                                                | In the playground             |
| -------------------------------------------------------------------------------------------------- | ----------------------------- |
| `bru.runner.*`                                                                                     | Warning. Use the desktop app. |
| OAuth2 credential helpers (`bru.getOauth2CredentialVar`, `bru.resetOauth2Credential`, and related) | Warning. Use the desktop app. |
| `bru.cookies.*`                                                                                    | Warning. Use the desktop app. |
| `bru.visualize`                                                                                    | Warning. Use the desktop app. |

If a collection depends on those APIs (iteration data, OAuth credential storage, cookie jar, or response visualization), run it in Bruno on the desktop. The playground is still useful for trying the request and for scripts that stay on the Safe Mode `bru` / `req` / `res` surface.

## Code Samples

The documentation generates copyable snippets for each request in:

* cURL
* Python (requests)
* JavaScript

## Tests and Scripts Display

The playground also shows:

* Pre-request and post-response scripts for each request
* Params, variables, body, headers, auth, and test logic
* Tests and assertions in the documentation
