Skip to main content
Node 18+. No dependencies. Works in Node, Bun, Deno, Cloudflare Workers and any Fetch-API runtime.

createBeacon(config)

resolve

Return null when there is no twin for a path. The caller then serves normal HTML, so an unmapped page is never hidden from a crawler.

analytics

The key authenticates writes for your whole site. On Vite, Astro or Next it must not carry a VITE_ or NEXT_PUBLIC_ prefix - those are inlined into the client bundle, which publishes it.

onError is worth wiring

fetch only rejects on transport failure. Without onError, a 404 from a misconfigured endpoint is indistinguishable from a successful send, and the dashboard simply stays empty forever.

beacon build

Writes a Markdown twin next to every HTML page in a directory.
--check in CI is the useful one: it fails the build when someone edits a page and forgets to regenerate, rather than shipping a twin that disagrees with the HTML.

Adapters

Install pages with working code for each: Next.js, Fetch frameworks, Express, Cloudflare Workers.

Classifying without the rest

The registry is exported on its own, if all you want is to recognise a User-Agent:
See the crawler registry for every entry.