Skip to main content
@onepatch/rum records page views, clicks, fetch and XHR requests, JS errors and web vitals, and links each request to the backend trace it caused. Paste this into your coding agent, with the endpoint and token from Workspace settings → integrations:
The token is write-only, so it is safe to commit and ship in your bundle, like a Sentry DSN. Commit and push. Sessions arrive the next time someone loads your app.

If your API is on another origin

Same-origin requests need no setup. For an API on a different origin:
  1. List that origin in connectTracesTo.
  2. Add traceparent to that API’s Access-Control-Allow-Headers. If the API accepts cookies, list traceparent by name — a * wildcard is not valid for requests that send credentials.

By hand

Call startRum once, on a path that only runs in the browser — it does not work during server-side rendering. user has no default, because telemetry with nobody attached cannot answer “what did this person do”, which is most of why you want it. A resolver may return null — a login page, a load before the session request lands — and (await startRum(…)).identified tells you whether anyone was attached. Pass user: "anonymous" only for an app with no sign-in. On a sign-out or a workspace switch, pass null for what no longer applies: identifyUser({ id: null, orgId: null }). An absent key leaves the previous value on every later span. The package README documents every option.

Privacy

The DOM is never captured, so keystrokes and form contents never leave the browser. Query strings are recorded. Set scrubQueryStrings: true if your URLs carry password-reset tokens or email addresses.