# Docs

The **Docs** tab is your live reference for whatever file you're working on. Select a file in the navigator on the left, and the Docs tab shows you exactly what that file receives, what helpers it can call, which Variables and Infrastructure bindings are currently available to it, and a complete example tailored to that file.

It's dynamic: add a Variable in the **Variables** tab or a binding in the **Infrastructure** tab, and the Docs tab immediately lists it by name and shows how to use it in the file you're viewing. That way you never have to leave the UI to look up a param shape or guess a binding name.

### What each file's reference contains

Every file (edge, browser, or API endpoint) has the same sections in the Docs tab:

* **When it runs** — a one-sentence description of the trigger for this file (page init, every event, user identity change, cron, browser load, etc.) and what it's typically used for.
* **Input (params)** — the full TypeScript shape of the `params` object this file receives. Includes every field, its type, and a short inline comment.
* **Helpers** — one block per helper available in this file, each with a usage signature and a one-line description. For edge files that's `requestHandler`, `userSave`, `providerSave`, `userGet`, `logger`; for `edge/scheduled` it adds the `reporting.*` and `userKey.*` helpers; for API handlers it's the `Response` return shape.
* **Variables** — the list of Variables currently configured, each shown as `params.secrets.NAME`. When nothing is configured you see a placeholder telling you to add Variables in the Variables tab.
* **Infrastructure Bindings** — the list of bindings currently configured, each shown as `params.infra.BINDING_NAME`. When nothing is configured you see a placeholder pointing at the Infrastructure tab.
* **Example** — a complete, copy-pasteable example that uses the params, helpers, and any Variables/bindings you've configured to show a realistic usage for this file.

### Dynamic sections

The **Variables** and **Infrastructure Bindings** sections reflect your current configuration in real time:

* Add a Variable named `API_KEY` in the [Variables](/playground/destination/variables.md) tab → the Docs panel for every edge file now shows `params.secrets.API_KEY` under Variables, and the Example updates to reference it.
* Add a D1 binding named `ORDERS_DB` in the [Infrastructure](/playground/destination/infrastructure.md) tab → the Docs panel now lists `params.infra.ORDERS_DB` and the Example shows a query against it.
* Mark a Variable as client-side → it now also appears in the Docs for browser files, under the correct access path (`params.manifest.variables.NAME` for `browser/init`, `params.manifestVariables.NAME` for `browser/tag` and `browser/user`).

This means you rarely need to guess: the name you see in Docs is the name you use in code.

### Switching between files

The file navigator on the left lists every file in the Destination: the edge files (`edge/init`, `edge/tag`, `edge/user`, `edge/scheduled`), browser files (`browser/init`, `browser/tag`, `browser/user`), and any CDN or Server API endpoints you've added. Clicking a file updates the Docs tab to that file's reference.

{% hint style="info" %}
Use Docs alongside the [Code](/playground/destination/code.md) tab while you're writing — Code shows your code, Docs shows the contract. They're designed to be read side by side.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edgetag.io/playground/destination/docs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
