Skip to content

RUM quickstart

By the end of this guide you’ll have the RUM SDK installed in a web app, a session showing up in the dashboard, and you’ll know how to identify users and track custom actions.

  1. RUM → Applications → New application.

  2. Name: Web app (or whatever’s descriptive). Domain: https://app.example.com. Save.

  3. The next screen shows the application_id and client_token — copy both. The client_token is public and ships in your bundle; the application_id is also public.

Terminal window
npm install @siteqwality/rum
// In your app's entry point, before any user code
import { SiteQwalityRUM } from '@siteqwality/rum';
await SiteQwalityRUM.init({
applicationId: 'abc123',
clientToken: 'pub_def456',
service: 'web',
version: '1.4.2',
env: 'prod',
});

For React/Vue/Svelte, init in the entry file (main.ts/main.js) before mounting the root component.

Load your app in a fresh browser. The SDK starts a session immediately and posts the first batch within ~10 seconds.

RUM → Sessions — your session appears at the top with web vitals, page count, and error count.

After login, identify the user:

SiteQwalityRUM.setUser({
id: 'usr_abc123',
email: 'alice@example.com',
name: 'Alice',
});

For business events:

// Track a user action
SiteQwalityRUM.addAction('checkout_completed', { variant: 'A' });
// Track a manual error (in addition to auto-captured ones)
try {
await chargeCard();
} catch (err) {
SiteQwalityRUM.addError(err, { feature: 'checkout', step: '3' });
throw err;
}

Minified JS errors aren’t very useful. Upload source maps so stacks resolve to original source — see Source maps how-to.