RUM quickstart
1. Create a RUM application
Section titled “1. Create a RUM application”-
Go to Observe → RUM. Without an application yet, the setup wizard opens; otherwise click Add application.
-
Name it
Web app, set Domain (optional) toapp.example.comand click Create application. -
Copy the application ID and the client token shown with the install snippet. Both are public and ship in your bundle.
With an API key exported as SITEQWALITY_API_KEY:
curl -X POST https://api.siteqwality.com/rum \ -H "Authorization: Bearer $SITEQWALITY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Web app", "domain": "app.example.com" }'The response includes id (the application_id) and client_token. Export the id as APP_ID for the API steps below.
2. Install the SDK
Section titled “2. Install the SDK”If your site sets a Content Security Policy, allow the SDK’s hosts first; see CSP and intake endpoints.
npm install @siteqwality/rum// In your app's entry point, before any user codeimport { SiteQwalityRUM } from '@siteqwality/rum';
SiteQwalityRUM.init({ applicationId: 'abc123', clientToken: 'pub_def456', // version: '1.4.2', // your release; enables source-mapped stack traces});For React/Vue/Svelte, init in the entry file (main.ts/main.js) before mounting the root component.
Paste this into your page’s <head>, as high as you can:
<script> (function(w,d,s,u){var r=w.SiteQwalityRUM=w.SiteQwalityRUM||{_q:[]};if(r._q&&!r._h){ ['init','setUser','clearUser','setGlobalAttribute','removeGlobalAttribute', 'addError','addAction','setView','setTrackingConsent','optOut','optIn', 'isOptedOut','startReplay','stopReplay','getSessionUrl','getStatus'].forEach(function(m){ r[m]=function(){r._q.push([m,arguments])}}); r._h=function(e){r._q.push(['_e',[e]])};w.addEventListener('error',r._h); w.addEventListener('unhandledrejection',r._h); var e=d.createElement(s);e.async=1;e.src=u;(d.head||d.documentElement).appendChild(e)} })(window,document,'script','https://cdn.siteqwality.com/rum/v2/sdk.min.js');
SiteQwalityRUM.init({ applicationId: 'abc123', clientToken: 'pub_def456', // version: '1.4.2', // your release; enables source-mapped stack traces });</script>The snippet loads the SDK asynchronously and queues your calls and any page errors until it arrives. It is a classic script and needs no type="module". To pin a release, load /rum/v2.3.2/sdk.min.js instead; see the release channels.
init() starts collection inside the call. Do not await the Promise it returns: it settles only once the remote config is applied or fails to load, so awaiting it delays your app.
With the npm package, calls made before init() (setUser, addError and the rest) are ignored, so call init() first. The CDN snippet queues them instead.
If your site needs consent before tracking, pass trackingConsent: 'pending' and call SiteQwalityRUM.setTrackingConsent('granted') once the visitor agrees. Nothing is sent until then. See consent and browser signals.
3. Open the app
Section titled “3. Open the app”Load your app in a fresh browser. The SDK starts a session immediately and posts the first batch within ~10 seconds.
4. See it in the dashboard
Section titled “4. See it in the dashboard”In RUM → Sessions, your session appears at the top. In the setup wizard, Verify data shows Receiving data once the first page view lands.
# Has anything arrived? last_seen_at is null until the first page view landscurl https://api.siteqwality.com/rum/$APP_ID/ingest-status \ -H "Authorization: Bearer $SITEQWALITY_API_KEY"
curl https://api.siteqwality.com/rum/$APP_ID/sessions \ -H "Authorization: Bearer $SITEQWALITY_API_KEY"If nothing shows up after a minute, check that:
- The CDN snippet sits in the page’s
<head>, orinit()runs in your app’s entry point. - Your Content Security Policy allows
https://cdn.siteqwality.cominscript-srcandconnect-src, andhttps://in.siteqwality.comandhttps://in-replay.siteqwality.cominconnect-src. - Consent is granted, if you passed
trackingConsent: 'pending'.SiteQwalityRUM.getStatus()in the browser console shows the consent state and what the SDK dropped. - No ad blocker is blocking those hosts in your test browser.
- The client token belongs to this application.
5. Identify users and track custom events
Section titled “5. Identify users and track custom events”After login, identify the user:
SiteQwalityRUM.setUser({ id: 'usr_abc123', email: 'alice@example.com', name: 'Alice',});Session search then finds the session by any part of the ID or email.
For business events:
// Track a custom eventSiteQwalityRUM.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;}6. Set up source maps (production)
Section titled “6. Set up source maps (production)”Upload source maps so minified stacks resolve to original source. See the Source maps how-to.
Set version in init() and change it on every deploy: errors carry it, and errors without a Debug ID match source maps by it, so keep it identical to the release you upload them to.