Describing what users do
rawrrr records what a visitor did before reporting a problem. Clicks and errors are recorded automatically. Your own words for what the user was doing make the report understandable: "Opened piece 'Clair de lune'" says more than click div.card:nth-child(3).
The snippet and its first line
<script>window.Rawrrr=window.Rawrrr||{q:[],log:function(){this.q.push(["log",[].slice.call(arguments),Date.now()])},setContext:function(){this.q.push(["setContext",[].slice.call(arguments),Date.now()])}};</script>
<script src="https://rawrrr.zengarden.space/rawrrr.js" data-project="prj_xxxxx" defer></script>
The first line is a tiny stub. It lets your code call Rawrrr.log() and Rawrrr.setContext() before the deferred widget has loaded: the calls are queued with their timestamps and handed over when the widget starts. If rawrrr never loads, the calls cost nothing. Paste both lines together.
The API
| Call | What it does |
|---|---|
Rawrrr.log(message, data?) | Records a descriptive event in the story. |
Rawrrr.setContext({ ... }) | Attaches current app state (document, mode, plan) to reports. |
data-rawrrr="Play piece" | A human name for an element. Clicks on it, or inside it, are recorded as click "Play piece" instead of a generated description. |
Rawrrr.timeline() | Returns the "Last moments" text exactly as the AI helper and the issue would see it. Use it in the browser console to check your instrumentation. |
window.Rawrrr?.log("Opened piece 'Clair de lune'", { bars: 48 });
window.Rawrrr?.setContext({ piece: "Clair de lune", mode: "practice" });
<button data-rawrrr="Play piece">▶</button>
Guard calls with window.Rawrrr?.log(...) so your app works without rawrrr, for example in tests.
Limits
- A message is at most 160 characters.
datahas at most 8 keys. Values are strings, numbers, booleans or null, at most 80 characters each.- The story keeps the last 60 events. More than 20 calls per second are dropped and leave one "N events dropped" entry.
- Everything is kept in memory in the visitor's browser and is sent only if they file a report.
Collapsing
Noisy repetition is merged so it does not push useful events out:
- The same event repeated back to back within 30 seconds becomes one entry with a count, like
click "Next page" ×7. - A run of scrolling becomes one entry with a range, like
scrolled 10% → 85% (max 85%). Resizing keeps only the last size. - Edits to the same field merge into one
email editedentry until another event comes between. - The same console message or failing request repeated back to back merges with a count.
Keep your phrasing stable ("Saved draft", not "Saved draft at 14:02") so collapsing works.
What to log
Log the moments that explain what the user was doing, in the app's words:
- screen and route changes: "Opened settings", not "/settings";
- opening and closing dialogs, menus, panels and tabs;
- the start and end of meaningful actions (save, upload, play, export, search, sign-in), including failures with a short reason;
- empty states, validation errors shown to the user, retries, offline and slow states.
Put app state worth knowing in setContext(), not in log().
Good and bad events
| Good | Bad | Why |
|---|---|---|
Opened piece "Clair de lune" | route /pieces/4812 | Intent in the app's words, not mechanics. |
Export failed: file too large | error | A short reason makes the report actionable. |
Export started then Export finished | export clicked, export handler ran, export fn called | One event per user action. |
Search submitted | Searched for "my medical condition" | Never log what the user typed. |
Saved draft | Saved draft at 14:02:11 | Stable phrasing collapses; timestamps do not. |
Opened account menu | a log inside a scroll or mousemove handler | The widget already records scrolling. No logging in render loops or timers. |
Privacy rules
- Never log typed text, emails, names, tokens or IDs that identify a person. Emails and token-looking strings are scrubbed automatically, but do not rely on it.
- Typed values are never recorded by the widget. Password, email, phone, card and address fields are blacked out in screenshots; add
data-rawrrr-maskordata-privateto anything else sensitive. - Calls to rawrrr itself are not recorded.
- On a public issue repo, the story is private attachment material by default; only what the reporter sees and agrees to is published. See public and private repos.
See also JavaScript API and Integrating from Claude Code, where Claude adds these calls for you.