JavaScript API

The snippet's first line defines a stub Rawrrr object, so Rawrrr.log(), Rawrrr.setContext(), Rawrrr.setUser() and Rawrrr.setLanguage() can be called before the widget has loaded: they are queued with their timestamps. (Snippets copied before December 2026 queue only the first three; call setLanguage as window.Rawrrr?.setLanguage?.(…) so an older stub ignores it, or update the snippet.) The other calls work once the widget has loaded (wait for the window load event).

CallWhat it does
Rawrrr.open()Opens the report window, as if the visitor tapped the tiger. Use it for your own "Report a problem" link.
Rawrrr.tickets()Opens the visitor's own tickets.
Rawrrr.setAppVersion(v)Sets the version string attached to reports, for apps that know it only at runtime.
Rawrrr.setUser({ id }), Rawrrr.setUser(null)Tells the widget who is signed in to your app, and that they signed out. Call it after sign-in (and when a saved session is restored) and with null after sign-out. Only a hash of the id leaves the page, never the id itself. Needed when only signed-in users should see the tiger. See Who sees the tiger.
Rawrrr.setLanguage(code), Rawrrr.setLanguage(null)Tells the widget the language your page is shown in, from your language switcher: a code such as de or pt-BR (anything else is ignored). null hands back to the page's <html lang>. Only needed when the project's app language is Auto and your switcher doesn't update <html lang>, which the widget follows by itself. See Language.
Rawrrr.setContext({ ... })Attaches small pieces of app state, such as the current piece or chapter, to reports.
Rawrrr.log(message, data?)Records a descriptive event of what the user is doing, for the "Last moments" story. See Describing what users do.
Rawrrr.timeline()Returns the "Last moments" text as the AI helper would see it, for checking your instrumentation.
data-rawrrr="Name"An attribute that gives an element a human name in recorded clicks.

Example

<button type="button" id="report">Report a problem</button>
<script>
  document.getElementById("report").addEventListener("click", () => Rawrrr.open());
  Rawrrr.setAppVersion("2.4.1");
  Rawrrr.setContext({ piece: "Nocturne in E-flat", measure: 12 });
</script>

Signed-in users

Use your app's own stable user id (a database id or your auth provider's user id), never an email or a name:

// in your auth listener: after sign-in, on session restore, and after sign-out
window.Rawrrr?.setUser?.(user ? { id: String(user.id), name: user.displayName, email: user.email } : null);

name, email and login are optional and never sent: the widget only removes them from what it records, so a click on an account menu that reads "Ann ▾" doesn't put Ann's name into the report. Mark account menus and profile areas with data-private too: clicks there are recorded by tag only, and screenshots black them out.

Language switchers

If your switcher already sets <html lang>, there is nothing to do. Otherwise, tell the widget once at start-up and on every change:

// i18next; any library: wherever the app's locale changes
i18n.on("languageChanged", (lng) => window.Rawrrr?.setLanguage?.(lng));

Guidance for context

  • Keep it small and factual: ids, names, positions.
  • Never put personal data or secrets in it. Context is attached to the report and, on a public repo, may end up in the public text or in the private attachment depending on what it is. See public and private repos.