Skip to main content
The MoleSignal Browser RUM SDK collects browser sessions, page views, user interactions, frontend errors, Web Vitals, network resources, and trace correlation context.

Prerequisites

  • the MoleSignal deployment URL;
  • a stable application identifier, such as checkout-web;
  • a dedicated token authorized to send RUM data into the target workspace.
clientToken is included in browser code and is visible to users. Never use an owner, administrator, or personal token. Use the application-bound msrum_ client token created by the data-source guide.

Install and initialize

1

Install the package

2

Initialize the SDK once

Initialize the SDK before the application router mounts to capture the first page view. Importing and initializing the package during server-side rendering is safe; browser instrumentation starts only when browser APIs exist.
3

Verify the first session

Open RUM → Overview and select a time range that includes the current time. Confirm that the application appears, then open Sessions to inspect the first session.
The site value can be a MoleSignal origin, /api base, or /api/v1 base. The SDK normalizes the value and sends data to the RUM endpoints beneath /api/v1/rum.

Identify users and add context

Provide the user during initialization when possible so the first session carries the correct identity.
When no user is provided, the SDK creates a stable anonymous identifier in localStorage. Set trackAnonymousUser: false when privacy policy does not allow persistent anonymous identity.

Add custom actions, errors, and views

Call rum.flush() before a controlled navigation or shutdown to wait for queued events. Call rum.stop() to remove instrumentation and flush the client.

Automatic collection defaults

Connect browser requests to traces

The fetch and XMLHttpRequest integrations read W3C traceparent from the outgoing request, response, or a Server-Timing entry named traceparent. For cross-origin APIs, expose the response headers and allow the origin explicitly:

Next steps

Data sampling

Control session and replay volume independently.

Privacy

Keep sensitive values on the user’s device.

Session replay

Record and replay DOM changes safely.

Source maps & symbols

Restore minified browser stacks and review the unified artifact workflow.
Last modified on August 9, 2026