Reference
beat.js
beat.js is the client tracker. It is roughly 3KB, sets no cookies, and reads no storage except a single owner opt-out flag.
Script attributes
Set on the <script> tag, read via document.currentScript.
| Field | Type | Required | Description |
|---|
Because beat.js reads document.currentScript, it must be a parser-inserted tag. Do not load it through a bundler-injected loader like next/script, which leaves currentScript null.
window.kymo
After load, window.kymo is a function for custom goals.
| Field | Type | Required | Description |
|---|
window.kymo('signup');
window.kymo('purchase', { revenue: 49 });If the owner opt-out is active, window.kymo is still defined but is a no-op, so your calls never error.
The beacon payload
Each event is a text/plain POST to /api/beat via navigator.sendBeacon (falling back to fetch with keepalive). The body is JSON:
| Field | Type | Required | Description |
|---|
The payload carries no cookie and no identifier you set. See /api/beat for what the server does with it.
Automatic behavior
- Pageviews fire on load and on every
history.pushStateandpopstate, de-duplicated on identical path plus query. - Outbound clicks — a click on a link to a different hostname sends an
outboundevent. - Auto-goals —
tel:,mailto:, WhatsApp links, and form submits fire goals with no configuration.
Opt-out and local development
?kymo=ignoresets a per-browserlocalStorageflag that stops sending;?kymo=trackclears it.- On
localhost,127.*, and192.168.*,beat.jsdoes nothing.