Frontend error tracking in Osuite
Overview
Section titled “Overview”The SDK listens on every uncaught error source by default:
window.errorfor runtime errors.unhandledrejectionfor unhandled Promise rejections.window.errorfor failed<img>/<script>/<link>/<audio>/<video>/<source>loads.- The optional
OsuiteErrorBoundaryfor React render crashes.
Every error is emitted as a log record with a full stack trace, the browser/route/user context at the time, and a stable event.name (browser.error, browser.unhandled_rejection, browser.resource_error, browser.react_error). Errors group on stack-trace fingerprint, so you can see frequency, browsers affected, and trend direction. From an error group, you can jump to the matching session replay or to the backend trace the request produced.
Which of these sources are active is controlled by the errors configuration.
Capture errors manually
Section titled “Capture errors manually”Report handled errors and messages with the public API:
import { osuite } from '@osuite/rum';
osuite.captureException(err, { extra: { feature: 'checkout', cartTotal: 42.5 }, level: 'error',});
osuite.captureMessage('payment retried', 'warn', { extra: { attempt: 2 },});extra keys become app.<key> log attributes. Levels are 'debug' | 'info' | 'warn' | 'error' | 'fatal'; 'fatal' triggers a sampling upgrade so the buffered context around the failure exports. The full public API is in the SDK reference.
React error boundary
Section titled “React error boundary”The React subpath adds an error boundary that catches render crashes. It lives on @osuite/rum/react so the baseline bundle never pulls React in:
import { OsuiteErrorBoundary } from '@osuite/rum/react';
export default function Root() { return ( <OsuiteErrorBoundary fallback={<ErrorPage />} onError={(err, info) => {/* optional side-effect */}} > <App /> </OsuiteErrorBoundary> );}Render errors get event.name='browser.react_error' and a react.component_stack attribute. The boundary also triggers a sampling upgrade so the buffered context around the crash exports.
Next steps
Section titled “Next steps”- Session replay — watch the recording of the session that hit an error
- Sampling — how error-triggered upgrade keeps broken sessions
- SDK reference — the
errorsconfiguration and full public API