@heretic-hq/collector opens an edge session, runs browser measurements, and posts the payload. It returns a request ID for a later server-side read.
Install
resolveEndpoint(config?), PROBE_VERSION, SURFACE_VERSION, and RENDER_VERSION.
There is no public Collector class, createCollector, collect method, or heretic.explain method.
Run one collection
{ ok: false, reason }. It starts one run per page. Later calls reuse the first run and do not apply a new configuration.
requestId is a join key, not a verdict. Ordinary success is { ok: true, requestId: "<32 lowercase hex>" }. The edge returns it only after the tenant projection is committed. ZDR success is exactly { ok: true } and has no request ID.
Public site key
siteKey accepts a public key in this form:
siteKey optional, but a missing, unknown, or revoked value does not produce a tenant-readable attribution. Use an hrtc_sk_... secret only on the server.
Configuration
The DoH object has this shape:
Endpoint resolution
resolveEndpoint(config?) checks candidates in this order:
config.endpoint- An HTTPS endpoint in
globalThis.__hereticEdge - A non-expired endpoint in
sessionStorage - DoH discovery when
dohis set - Control-plane discovery when
controlPlaneis set - The first configured fallback, or
https://tcp.waw.probe.heretic.quest
The browser must connect directly to the selected measurement edge. A proxy in front of that endpoint changes the connection being measured.
Request sequence
A normal run makes these requests:zdr: true, the final request is:
Script tag
The browser build defines a globalheretic function:
dist/heretic.js from your origin. An edge-hosted bundle self-targets the edge that served it. Call the global with a public key for tenant attribution:
Collection controls
surface
surface: false removes the declared-surface section. Current rules read fields from that section, so disabling it can reduce coverage or remove findings. The payload records the configured omission.
render
render: false omits fixed canvas and WebGL raster collection. It does not disable identity. The base measured payload can still supply canvas or audio anchors, and the machine ID uses cores, display, and timezone.
rawSurface
rawSurface: false keeps the surface section but coarsens or omits exact forms of:
- WebRTC host candidate addresses
- battery level and finite charge or discharge times
- storage quota and usage
budgetMs
The collector checks budgetMs between sections in the core measured phase. A section already running may finish after the budget. Skipped sections record skipped: 'budget-cut' and appear in budget.cut.
Fixed rendering and declared-surface collection run afterward, outside budgetMs. Declared-surface sections have their own deadlines. budgetMs is not a whole-run deadline.
zdr
zdr: true posts to /z. Parsed claims stay request-local. A valid request creates no assessment, identity, projection, NDJSON record, request ID, or retrievable session. It removes the owned per-nonce session and linked state, then returns { ok: true }.
Malformed or incomplete ZDR submissions retain only a hidden, nonpersistable baseline marker. They retain none of the submitted request data.
Worker CSP
The parallel probe usesblob: workers. If the page’s CSP blocks them, the payload records:

