> ## 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.

# Script tag

> Load the collector from the sensor and measure the visitor.

```html theme={"dark"}
<script src="https://probe.heretic.tech/client.js"></script>
<script>
  heretic({ siteKey: 'hrtc_live_0123456789abcdef01234567' }).then(async (result) => {
    if (!result.ok) return;
    await fetch('/api/heretic', { method: 'POST', body: result.requestId });
  });
</script>
```

The script defines a global `heretic` function. It runs once per page; later calls return the same run. `result.requestId` is a 32-character hex string. It is readable at [`GET /v1/verdict`](/api/verdict-endpoint) as soon as the promise resolves.

The site key is public. It attributes the session to a site and reads nothing.

## Content security policy

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

To serve the bundle from your own origin, use `dist/heretic.js` from the [npm package](/collector/npm-package) and name your origin in `script-src`.

[Options and result](/collector/options) lists every `heretic(config)` option and the result shape.


## Related topics

- [Quickstart](/quickstart.md)
- [Collector options and result](/collector/options.md)
- [Troubleshooting](/troubleshooting.md)
- [Heretic documentation](/index.md)
- [Challenge widget](/integration/challenge-widget.md)
