RUM Quickstart Guide

Get started with Real User Monitoring in less than 5 minutes.

Step 1: Create an Observability App

  1. Navigate to Dashboard β†’ Observability β†’ Apps
  2. Click "Create App"
  3. Fill in the details:
    • Name: My Website
    • Type: Frontend (RUM)
    • Domains: example.com, www.example.com (comma-separated)
  4. Click "Create"
  5. Copy your API Key (shown once)

Step 2: Install the RUM SDK

Add to your <head>:

<script>
(function(w,d,s,r,k,a){
  w.StatusRadarRUM=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)};
  a=d.createElement(s);a.async=1;a.src='https://cdn.statusradar.dev/rum/v1/rum.min.js';
  d.head.appendChild(a);
})(window,document,'script','rum');

rum('init', {
  apiKey: 'your-api-key-here',
  appId: 'your-app-id-here',
  endpoint: 'https://rum.statusradar.dev/v1/ingest'
});
rum('start');
</script>

Step 3: Verify Data Collection

  1. Open your website in a browser
  2. Navigate to Dashboard β†’ Observability β†’ Apps β†’ [Your App]
  3. You should see:
    • Session count increasing
    • Events appearing in real-time
    • Core Web Vitals metrics

Configuration Options

Basic Configuration

rum('init', {
  apiKey: 'your-api-key-here',     // Required: Your app API key
  appId: 'your-app-id-here',       // Required: Your app ID
  endpoint: 'https://rum.statusradar.dev/v1/ingest', // Required

  // Optional settings
  sampleRate: 1.0,                  // 0.0-1.0 (1.0 = 100% of sessions)
  sessionTimeout: 1800000,          // 30 minutes
  trackInteractions: true,          // Track clicks
  trackConsole: true,               // Capture console logs
  trackErrors: true,                // Capture JS errors
  sessionReplay: false              // Enable session replay (see session-replay.md)
});
rum('start');

What Gets Tracked Automatically?

Page Load Events

  • DNS lookup time
  • TCP connection time
  • DOM parsing time
  • Resource loading time
  • Total page load time

Core Web Vitals

  • LCP (Largest Contentful Paint)
  • INP (Interaction to Next Paint)
  • CLS (Cumulative Layout Shift)
  • FCP (First Contentful Paint)
  • TTFB (Time to First Byte)

Navigation

  • Page views
  • SPA route changes
  • Back/forward navigation

Errors

  • JavaScript errors
  • Unhandled promise rejections
  • Resource load failures

Framework Integration

For React, Vue.js, Next.js, and other frameworks, add the RUM script to your main HTML template:

React (public/index.html)

<!DOCTYPE html>
<html>
  <head>
    <!-- Add RUM SDK -->
    <script>
    (function(w,d,s,r,k,a){
      w.StatusRadarRUM=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)};
      a=d.createElement(s);a.async=1;a.src='https://cdn.statusradar.dev/rum/v1/rum.min.js';
      d.head.appendChild(a);
    })(window,document,'script','rum');

    rum('init', {
      apiKey: '%REACT_APP_STATUSRADAR_KEY%',
      appId: '%REACT_APP_STATUSRADAR_APP_ID%',
      endpoint: 'https://rum.statusradar.dev/v1/ingest'
    });
    rum('start');
    </script>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

Vue.js (public/index.html)

<!DOCTYPE html>
<html>
  <head>
    <!-- Add RUM SDK -->
    <script>
    (function(w,d,s,r,k,a){
      w.StatusRadarRUM=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)};
      a=d.createElement(s);a.async=1;a.src='https://cdn.statusradar.dev/rum/v1/rum.min.js';
      d.head.appendChild(a);
    })(window,document,'script','rum');

    rum('init', {
      apiKey: process.env.VUE_APP_STATUSRADAR_KEY,
      appId: process.env.VUE_APP_STATUSRADAR_APP_ID,
      endpoint: 'https://rum.statusradar.dev/v1/ingest'
    });
    rum('start');
    </script>
  </head>
  <body>
    <div id="app"></div>
  </body>
</html>

Next.js (pages/_document.js)

import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
  return (
    <Html>
      <Head>
        <script dangerouslySetInnerHTML={{
          __html: `
            (function(w,d,s,r,k,a){
              w.StatusRadarRUM=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)};
              a=d.createElement(s);a.async=1;a.src='https://cdn.statusradar.dev/rum/v1/rum.min.js';
              d.head.appendChild(a);
            })(window,document,'script','rum');

            rum('init', {
              apiKey: '${process.env.NEXT_PUBLIC_STATUSRADAR_KEY}',
              appId: '${process.env.NEXT_PUBLIC_STATUSRADAR_APP_ID}',
              endpoint: 'https://rum.statusradar.dev/v1/ingest'
            });
            rum('start');
          `
        }} />
      </Head>
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  )
}

Verifying Installation

Browser Console

Check for RUM initialization:

console.log(window.StatusRadarRUM);
// Should output: { version: "1.0.0", sessionId: "...", ... }

Network Tab

Look for POST requests to rum.statusradar.dev/v1/ingest with:

  • Status code: 202 (Accepted)
  • Payload: Compressed event data

Dashboard

Navigate to Dashboard β†’ Observability β†’ Apps and verify:

  • βœ… Sessions count > 0
  • βœ… Events count > 0
  • βœ… Last event timestamp recent

Common Issues

No data appearing in dashboard

  1. Check domain whitelist: Ensure your domain is added to the app
  2. Verify API key: Check browser console for authentication errors
  3. Check CORS: Look for CORS errors in console
  4. Verify endpoint: Ensure https://rum.statusradar.dev/v1/ingest is reachable

High event count

Events include: pageload, vitals, errors, clicks, console logs, network requests.

To reduce:

rum.configure({
  trackInteractions: false,  // Disable click tracking
  trackConsole: false,       // Disable console logs
  trackNetwork: false        // Disable network requests
});

Next Steps