> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heretic.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Collector options and result

> Every heretic(config) option, the result shape, and zero data retention.

`heretic(config)` is the same function from the [script tag](/collector/script-tag) and the [npm package](/collector/npm-package). It runs once per page. Pass the complete configuration to the first call.

## Result

```ts theme={"dark"}
type HereticResult =
  | { ok: true; sessionCreated: true; requestId: string }
  | { ok: false; sessionCreated: true; requestId: string; reason: string }
  | { ok: false; sessionCreated: false; requestId: null; reason: string };
```

`requestId` is a 32-character lowercase hex string, readable at once from your backend. `sessionCreated: true` with `ok: false` means the sensor opened a session that did not complete; it finalizes as `refused` 15 seconds after opening. `sessionCreated: false` means nothing to read. `reason` is prose.

## Options

| Option                                                          | Type    | Default   | Purpose                                                                   |
| --------------------------------------------------------------- | ------- | --------- | ------------------------------------------------------------------------- |
| `siteKey`                                                       | string  | none      | Attributes the session to a site. Required.                               |
| `zdr`                                                           | boolean | false     | Zero data retention. One read within ten seconds, nothing stored.         |
| `tag`                                                           | string  | unset     | Free-text diagnostic tag, returned in `record.tag`.                       |
| `auto`                                                          | boolean | true      | Waits for page load and an idle moment before measuring.                  |
| `idleTimeoutMs`                                                 | number  | 2000      | Longest idle wait.                                                        |
| `budgetMs`                                                      | number  | 8000      | Latest start for a measurement section. Not a deadline for the whole run. |
| `postTimeoutMs`                                                 | number  | 8000      | Limit on the final submission.                                            |
| `surface`                                                       | boolean | true      | Browser-declared properties. `false` lowers coverage.                     |
| `render`                                                        | boolean | true      | Canvas and WebGL output. `false` removes the `identity.instance` inputs.  |
| `rawSurface`                                                    | boolean | false     | Exact WebRTC address, battery, and storage values instead of buckets.     |
| `endpoint`, `quicEndpoint`, `fallbackEdges`, `doh`, `fetchImpl` |         | automatic | Self-hosted development only.                                             |

## Zero data retention

```js theme={"dark"}
const result = await heretic({ siteKey: 'hrtc_live_0123456789abcdef01234567', zdr: true });
```

The result stays in sensor memory for ten seconds and allows one authorized read, which destroys it. Nothing reaches the event store or the dashboard. See [privacy and retention](/data/privacy-and-retention).

## Content security policy

```text theme={"dark"}
script-src 'self' 'wasm-unsafe-eval';
connect-src https://probe.heretic.tech;
worker-src blob:;
```

Add `https://probe.heretic.tech` to `script-src` when loading by script tag. Blocked blob workers reduce compute coverage. Do not put a CDN or proxy between the browser and the sensor; the sensor would measure the proxy.

## Exports

`heretic`, `resolveEndpoint`, `PROBE_VERSION`, `SURFACE_VERSION`, `RENDER_VERSION`, `COLLECTOR_VERSION`, `TELEMETRY_CONTRACT_VERSION`, `WASM_PROBE_VERSION`. The script tag exposes the same values as properties of `heretic`.


## Related topics

- [Script tag](/collector/script-tag.md)
- [npm package](/collector/npm-package.md)
- [Verdict endpoint](/api/verdict-endpoint.md)
- [Quickstart](/quickstart.md)
- [Signup rules](/integration/writing-rules.md)
