Real User Monitoring (RUM)
Oodle RUM gives you end-to-end visibility into how real users experience your web and React Native apps: load performance, JavaScript errors and crashes, user interactions, and full session replay. Choose your platform below. The rest of this page describes the browser SDK; the React Native SDK has its own page, React Native RUM.
Installation
- Browser
- React Native
npm install @oodle-ai/rum
npm install @oodle-ai/mobile-sdk-reactnative
# iOS (bare React Native). Android needs no step.
cd ios && pod install
The SDK has native code. On Android, Gradle links it
when it builds the app; on iOS, CocoaPods links it.
Build the app again after you install it. With Expo,
use a development build (npx expo prebuild): Expo Go
cannot load native code.
Quick Start
- Browser
- React Native
Add the following to your application entry point
(e.g. main.ts, App.tsx, or a layout component):
import { OodleRum } from '@oodle-ai/rum';
OodleRum.init({
instanceId: '<YOUR_INSTANCE_ID>',
apiKey: '<YOUR_RUM_API_KEY>',
endpoint: 'https://<YOUR_COLLECTOR>.oodle.ai',
service: 'my-frontend',
env: 'production',
version: '1.0.0',
sessionReplay: true,
sessionSampleRate: 100,
replaySampleRate: 100,
privacyLevel: 'mask-user-input',
allowedTracingUrls: [
'https://api.yourapp.com',
],
});
Wrap the app in OodleProvider. It starts the SDK
during the first render and records taps.
useOodleNavigationTracking starts a view for each
react-navigation screen.
import {
NavigationContainer,
useNavigationContainerRef,
} from '@react-navigation/native';
import {
OodleProvider,
useOodleNavigationTracking,
} from '@oodle-ai/mobile-sdk-reactnative';
const config = {
instanceId: '<YOUR_INSTANCE_ID>',
apiKey: '<YOUR_RUM_API_KEY>',
endpoint: 'https://<YOUR_COLLECTOR_DOMAIN>',
service: 'my-app',
env: 'production',
allowedTracingUrls: ['api.example.com'],
};
export default function App() {
const navigationRef = useNavigationContainerRef();
useOodleNavigationTracking(navigationRef);
return (
<OodleProvider config={config}>
<NavigationContainer ref={navigationRef}>
{/* screens */}
</NavigationContainer>
</OodleProvider>
);
}
The options, crash reporting, session replay and source map upload of the React Native SDK are on React Native RUM.
API Key
RUM uses a dedicated API key with the RUM role. This key is embedded in client-side JavaScript and is visible to end users. It is restricted to writing RUM events and replay segments only — no read access to any other data.
Create a RUM API key from Settings → API Keys → Create API Key and select the RUM role.
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
instanceId | string | required | Your Oodle instance ID |
apiKey | string | required | RUM API key |
endpoint | string | required | Collector URL (*.oodle.ai) |
service | string | required | Application name |
env | string | — | Environment (production, staging) |
version | string | — | Application version |
sessionReplay | boolean | true | Enable session recording |
sessionSampleRate | number | 100 | % of sessions to capture |
replaySampleRate | number | 100 | % of sessions to record replay |
privacyLevel | string | 'mask-user-input' | Privacy masking level |
allowedTracingUrls | array | — | URLs to inject traceparent |
openTelemetry | boolean | object | — | Enable OTel browser tracing |
tags | object | — | Custom key-value tags on every event |
viewUrlQueryParams | string[] | — | Query parameters to keep in view_url |
forwardNetworkHeaders | object | — | Capture request and response headers for matching URLs: { urls } |
forwardNetworkBodies | object | — | Capture request and response bodies for matching URLs: { urls, maxBodySize }, maxBodySize default 65536 characters |
flushIntervalMs | number | 5000 | How often queued events are sent, in ms |
replayFlushIntervalMs | number | 5000 | How often replay data is sent, in ms |
replayIdlePauseMs | number | 300000 | Pause replay recording after this long without user activity (5 min); it resumes on the next interaction |
replayIdleExpireMs | number | 900000 | End the replay after this long without user activity (15 min); the next interaction starts a new one |
shouldSendData | function | — | Called before each send. While it returns false, data is held (up to 5 min) and retried. Not checked for the last send when the page is closed |
urlPathPatterns | string[] | — | Route templates that mask names and IDs in URL paths |
maskUrlPath | function | — | Your own rewrite of URL paths |
referrerUrl | string | 'path' | 'path', 'origin' or 'none' |
stripQueryStrings | string | 'events' | 'all' also removes query strings from replay and trace URLs |
consoleLevels | string[] | ['error', 'warn'] | Console levels to record; [] for none |
errorMessages | string | 'full' | 'full', 'scrub' or 'none' |
actionText | string | 'mask' with privacyLevel: 'mask', else 'full' | 'mask' sends no element text with clicks |
userAgent | string | 'full' | 'none' sends no user agent string |
userInfo | string | 'full' | 'full', 'id' or 'none' |
redactHeaders | array | — | More captured header names never sent |
redactBodyKeys | array | — | More captured body keys whose values are replaced |
beforeSendNetwork | function | — | Change or remove captured headers and bodies |
beforeSend | function | — | Change or drop any event |
Each linked option is described in Data Privacy, with every value and an example.
OpenTelemetry Browser Tracing
The SDK supports full OpenTelemetry auto-instrumentation, linking browser requests to backend traces end-to-end.
You do not install other packages: the OpenTelemetry
packages are dependencies of @oodle-ai/rum. The SDK
loads them in separate chunks only when
openTelemetry is on, so an app without tracing does
not download them.
Enable in config
OodleRum.init({
// ... base config ...
allowedTracingUrls: [
'https://api.yourapp.com',
],
openTelemetry: { enabled: true },
});
Unhandled promise rejections
RUM records unhandled promise rejections with
tracing on. Tracing uses zone.js, though, and while
it is on the browser's unhandledrejection event
does not fire for most promises, so any listener your
app adds for that event misses them.
How it works
- The SDK initializes an OpenTelemetry
WebTracerProviderwith aBatchSpanProcessorthat exports spans to your Oodle collector via OTLP HTTP (/v1/traces). @opentelemetry/auto-instrumentations-webautomatically creates spans for page loads, fetch/XHR requests, and user interactions.- For URLs matching
allowedTracingUrls, thetraceparentheader is injected into outgoing requests — your backend picks up the sametrace_idand the full trace appears in Oodle's Traces UI.
Advanced options
openTelemetry: {
enabled: true,
tracesEndpoint: 'https://custom-collector/v1/traces',
customAttributes: {
'team.name': 'frontend',
},
}
Session Replay
Session replay records a pixel-perfect reproduction of the user's browser session using rrweb.
Privacy levels
| Level | Behavior |
|---|---|
allow | No masking |
mask-user-input | Mask input fields, textareas |
mask | Mask all text content |
Sampling
Use replaySampleRate to control costs. For example,
set replaySampleRate: 10 to record 10% of sessions.
Images, fonts and stylesheets
A replay draws your pages in an isolated frame on the replay host of your Oodle region. That host has no access to your Oodle session. The browser of the person who opens the replay loads your images, stylesheets and fonts from your servers, as the browser of your user did. Serve them over HTTPS from hosts that this person can reach.
Browsers load a font from another site only when the
font's host allows that site with CORS. If your font
host sends Access-Control-Allow-Origin: *, your fonts
show in replays with no change. If it allows only your
own sites, also allow the replay host of your region:
| Oodle UI that you sign in to | Replay host to allow |
|---|---|
https://us1.oodle.ai | https://us1-session-replay.oodle.ai |
https://eu1.oodle.ai | https://eu1-session-replay.oodle.ai |
https://ap1.oodle.ai | https://ap1-session-replay.oodle.ai |
For example, a font host for a customer on us1 sends:
Access-Control-Allow-Origin: https://us1-session-replay.oodle.ai
Images and stylesheets need no CORS change.
Data Privacy
The options in this section need @oodle-ai/rum
0.6.0 or later.
Some data is always kept out, whatever the settings: query strings in event URLs, credential, session and IP address headers and fields in captured network data, and the text of elements masked in session replay. The options below send less. Each one is off by default.
| Data | Sent by default | Option |
|---|---|---|
| URL paths | As in the address bar | urlPathPatterns, maskUrlPath |
| Query strings on replay and span URLs | Kept | stripQueryStrings |
| Referrer | Origin and path | referrerUrl |
| Console output | Errors and warnings | consoleLevels |
| Error and console messages | As written | errorMessages |
| Clicked element text | Sent | actionText |
| User agent string | Sent | userAgent |
| User name and email | Sent | userInfo |
| Captured headers and bodies | Not captured unless enabled | redactHeaders, redactBodyKeys, beforeSendNetwork |
| Anything else in an event | Sent | beforeSend |
A configuration that sends as little as possible:
OodleRum.init({
// ... base config ...
privacyLevel: 'mask',
urlPathPatterns: [
'/projects/:project/tables/:table',
'/projects/:project/*',
],
referrerUrl: 'none',
consoleLevels: ['error'],
errorMessages: 'none',
actionText: 'mask',
userAgent: 'none',
stripQueryStrings: 'all',
userInfo: 'id',
// Only if forwardNetworkHeaders or
// forwardNetworkBodies is set:
beforeSendNetwork: () => null,
});
If an option gets a value it does not accept, the SDK uses its most private setting and logs a console warning.
Option reference
Every option is set in OodleRum.init(). Each entry
below lists what the option controls, every value it
accepts, and an example.
urlPathPatterns
Masks parts of URL paths, such as project or table
names, before they are sent. Applies to view_url,
view_url_path, referrer_url, network request URLs,
the session replay page URL and trace spans.
| Value | What it does |
|---|---|
| Not set (default) | Paths are sent as they are in the browser. |
| Array of route templates | A path that matches a template is sent as the template. The first matching template wins. A path that matches none is sent unchanged. |
How a template is written:
| In a template | Matches | Sent as |
|---|---|---|
projects (plain text) | Exactly that segment (case-sensitive) | The segment |
:project | Any one segment | :project |
/* at the end | All remaining segments | * |
A template without /* matches only paths with the
same number of segments.
Example:
urlPathPatterns: [
'/projects/:project/tables/:table',
'/projects/:project/*',
'/api/projects/:project/*',
],
| Path in the browser | Sent as |
|---|---|
/projects/acme/tables/salaries | /projects/:project/tables/:table |
/projects/acme/settings/billing | /projects/:project/* |
/api/projects/acme/tables/salaries/rows | /api/projects/:project/* |
/settings | /settings (no match) |
List your API routes too, because network request URLs use the same templates.
A path that matches no template is sent unchanged,
including a not-found page or a route added after you
wrote the list. After the specific routes of each
section, add a catch-all that ends in /*, so those
paths are masked too:
urlPathPatterns: [
'/projects/:project/tables/:table',
'/projects/:project',
'/projects/:project/*', // any other path under a project
],
maskUrlPath
Rewrites URL paths with your own function, for rules a
template cannot express. Applies wherever
urlPathPatterns applies, and runs after it.
| Value | What it does |
|---|---|
| Not set (default) | No extra rewriting. |
(path: string) => string | Gets each path and returns the path to send. If it throws or does not return a string, the SDK sends /:redacted, so a bug in the function never sends the raw path. |
Example:
maskUrlPath: (path) =>
path.replace(/\/users\/[^/]+/, '/users/:id'),
| Path in the browser | Sent as |
|---|---|
/users/jane/profile | /users/:id/profile |
referrerUrl
Controls referrer_url, the page the user came from.
| Value | What it does |
|---|---|
'path' (default) | Sends the origin and path. Query strings are always removed. urlPathPatterns applies to the path. |
'origin' | Sends only the origin. |
'none' | Sends referrer_url empty. |
Example:
referrerUrl: 'origin',
| Referrer | 'path' | 'origin' | 'none' |
|---|---|---|---|
https://app.example.com/projects/acme?token=1 | https://app.example.com/projects/acme | https://app.example.com | empty |
stripQueryStrings
Controls where query strings are removed. Event URLs
(view_url, referrer_url, network request URLs)
never have them.
| Value | What it does |
|---|---|
'events' (default) | The session replay page URL and the url.full attribute on trace spans keep the full query string. |
'all' | The replay page URL keeps only the parameters in viewUrlQueryParams, like view_url. Span url.full has no query string. |
Example:
stripQueryStrings: 'all',
viewUrlQueryParams: ['traceId'],
| URL | Replay page URL sent | Span url.full sent |
|---|---|---|
https://app.example.com/traces?traceId=abc&token=s3cret | https://app.example.com/traces?traceId=abc | https://app.example.com/traces |
consoleLevels
Controls which console calls are recorded as console events.
| Value | What it does |
|---|---|
['error', 'warn'] (default) | Records console.error and console.warn. |
['error'] | Records console.error only. |
['warn'] | Records console.warn only. |
[] | Records no console output. |
A level that is not listed is not intercepted at all.
Example:
consoleLevels: ['error'],
errorMessages
Controls the message text of errors and console
events: error_message, the message line at the top
of error_stack, and console_message.
| Value | What it does |
|---|---|
'full' (default) | Sends messages as written. |
'scrub' | Replaces quoted strings, URLs, emails, UUIDs, long hex IDs and numbers of 4 or more digits. Errors of the same kind still group together. Unquoted words are kept. |
'none' | Sends no message text. |
In every mode, error_type and the stack frames are
sent, so stacks still map to source.
Example:
errorMessages: 'scrub',
| Message | 'full' | 'scrub' | 'none' |
|---|---|---|---|
Table 'salaries' not found for [email protected] | Unchanged | Table '?' not found for <email> | empty |
Use 'none' if your messages can name records
without quotes, because 'scrub' keeps unquoted
words.
actionText
Controls the clicked element's text in click events
(action_text and action_target).
| Value | What it does |
|---|---|
'full' | Sends the element's text, aria-label or title. |
'mask' | Sends only the tag, id and classes. |
| Not set (default) | 'mask' when privacyLevel is 'mask', otherwise 'full'. |
Elements masked or hidden in session replay
(data-oodle-privacy="mask" or "hidden") never have
their text sent, whatever the value.
Example:
actionText: 'mask',
| Clicked element | 'full' | 'mask' |
|---|---|---|
<button id="delete-btn">Delete table salaries</button> | button[Delete table salaries] | button#delete-btn |
To give an element a name of your choice, set
data-oodle-action-name on it or on an ancestor. The
name is sent instead of the element's text, with
either value, because you wrote it to be sent:
| Clicked element | Sent as |
|---|---|
<button data-oodle-action-name="Delete table">Delete table salaries</button> | button[Delete table] |
userAgent
Controls the full browser user agent string.
| Value | What it does |
|---|---|
'full' (default) | Sends the full string in user_agent. |
'none' | Sends user_agent empty. browser_name, os_name and device_type are still sent, so you can still filter by browser and device. |
Example:
userAgent: 'none',
userInfo
Controls which fields from OodleRum.identify() are
sent on every event.
| Value | What it does |
|---|---|
'full' (default) | Sends user_id, user_name and user_email. |
'id' | Sends user_id only. user_name and user_email are empty. |
'none' | Sends none of the three. |
user_status (identified or anonymous) is sent
in every mode.
Example:
userInfo: 'id',
redactHeaders
Header names that are never sent, on top of the
built-in list. Applies to request and response
headers captured by forwardNetworkHeaders.
| Value | What it does |
|---|---|
| Not set (default) | Only the built-in list is removed (see below). |
| Array of strings | Removes headers with these names. Matching ignores case. |
| Array with RegExps | Removes headers whose lowercase name matches. Strings and RegExps can be mixed. |
These headers are always removed, whatever the
settings: any header whose name contains token, secret,
auth, cookie, passw, api-key, apikey,
access-key, session, csrf, xsrf, client-ip,
real-ip or connecting-ip, and the forwarded and
*-forwarded-for headers. That covers, for example,
authorization, cookie, x-api-key,
x-auth-token, x-session-id, x-forwarded-for,
x-real-ip and cf-connecting-ip.
Example:
redactHeaders: ['x-debug-client-ip', /^x-internal-/],
| Captured header | Sent? |
|---|---|
x-forwarded-for: 203.0.113.7 | No (built-in) |
x-debug-client-ip: 203.0.113.7 | No (built-in: contains client-ip) |
x-internal-shard: 4 | No (matches /^x-internal-/) |
x-request-id: req-123 | Yes |
redactBodyKeys
Body keys whose values are replaced with [REDACTED],
on top of the built-in list. Applies to JSON bodies,
at any depth, and to form-encoded bodies captured by
forwardNetworkBodies.
| Value | What it does |
|---|---|
| Not set (default) | Only the built-in keys are redacted (see below). |
| Array of strings | Also redacts these keys. Matching ignores case, -, _ and ., so 'employee-id' matches employeeId and employee_id. |
| Array with RegExps | Also redacts keys that match, tested against the key as written. |
The built-in redaction always runs, whatever the settings:
| Kind | Redacted |
|---|---|
| Credentials | Keys containing passw, secret, token (not token counts and limits such as total_tokens or max_tokens), apikey, accesskey, privatekey, authorization, credential |
| Payment and ID data | Keys containing cardnumber, creditcard, cvv, cvc, securitycode, socialsecurity, and the keys ssn and pan |
| IP addresses | Keys containing ipaddr, clientip, remoteaddr, remoteip, and the keys ip, ipv4, ipv6 |
| Card numbers | Any payment card number in the body, found by its checksum |
Example:
redactBodyKeys: ['email', 'phone', /^salary/],
| Captured body | Sent as |
|---|---|
{"user":{"email":"[email protected]","ip":"203.0.113.7","plan":"pro"}} | {"user":{"email":"[REDACTED]","ip":"[REDACTED]","plan":"pro"}} |
beforeSendNetwork
A function that changes or removes the headers and
bodies captured by forwardNetworkHeaders and
forwardNetworkBodies, before they are sent. It runs
once for each request that captured something.
It gets one object:
| Field | Contents |
|---|---|
url | The request URL as it is sent (no query string, path masked). Read only. |
method, status | The request method and response status (0 if the request failed). Read only. |
requestHeaders, responseHeaders | Captured headers, as { name: value } with lowercase names. |
requestBody, responseBody | Captured bodies, as strings. |
| What the function does | What is sent |
|---|---|
| Changes the object and returns nothing | The changed headers and bodies. |
| Returns a new object | The headers and bodies in that object. |
Returns null | No headers or bodies for that request. |
| Throws or returns a promise | No headers or bodies for that request. The SDK logs one console warning. The function must be synchronous. |
In every case, the request's timing event (URL,
method, status and duration) is still sent. The
built-in redaction, redactHeaders and
redactBodyKeys are applied first, so the function
never sees those values.
Example: replace IP addresses in bodies, and send nothing captured for one endpoint:
beforeSendNetwork: (capture) => {
const ip = /\b\d{1,3}(\.\d{1,3}){3}\b/g;
if (capture.responseBody) {
capture.responseBody =
capture.responseBody.replace(ip, '<ip>');
}
if (capture.url.endsWith('/auth/token')) {
return null;
}
},
| Response body | Sent as |
|---|---|
{"viewer":{"origin":"203.0.113.7"}} | {"viewer":{"origin":"<ip>"}} |
beforeSend
A function called with every event before it is sent: views, actions, errors, console, network requests, long tasks, custom events and tab visibility. Use it for anything the other options do not cover. It runs after all of them, so it sees each event as it would be sent.
| What the function does | What is sent |
|---|---|
| Changes the event and returns nothing | The changed event. |
| Returns a new object | That object. |
Returns null or false | Nothing. The event is dropped. |
| Throws or returns a promise | Nothing. The event is dropped, and the SDK logs one console warning. The function must be synchronous. |
session_id, event_type and timestamp cannot be
changed. Session replay data does not pass through
beforeSend; use privacyLevel and the replay
markers for replay.
Example: drop console events from one library, and remove a field from custom events:
beforeSend: (event) => {
if (
event.event_type === 'console' &&
String(event.console_message).includes('[vendor]')
) {
return null;
}
delete event.custom_event_properties;
},
User Identification
OodleRum.identify({
id: 'user-123',
name: 'Jane Doe',
email: '[email protected]',
});
Custom Events
OodleRum.trackEvent('purchase_completed', {
orderId: 'ORD-456',
amount: 99.99,
currency: 'USD',
});
Feature Flags
OodleRum.addFeatureFlag('new-checkout', 'enabled');
Content Security Policy
If your app uses CSP, add the collector domain to
connect-src:
connect-src 'self' https://<YOUR_COLLECTOR>.oodle.ai;
Troubleshooting
CORS errors on traced requests
If you see CORS errors after enabling
allowedTracingUrls, your backend must allow the
traceparent header:
Access-Control-Allow-Headers: traceparent
Tracing does not start
If the OpenTelemetry chunks fail to load, the SDK logs a warning and continues without tracing. RUM data is unaffected.
Privacy options have no effect
The privacy options need @oodle-ai/rum 0.6.0 or
later. Run npm ls @oodle-ai/rum to check the
installed version. The SDK logs a console warning for
an option value it does not accept, and for a
urlPathPatterns entry it ignores.
No data appearing
- Check the browser console for SDK errors
- Verify the API key has the RUM role
- Confirm
endpointpoints to your collector - Allow 2–5 minutes for data to propagate
Support
If you need assistance or have any questions, please reach out to us through:
- Email at [email protected]