Before you start
You need three things:- An Atatus RUM application and its license key.
- A build tool that resolves npm packages, such as Vite, webpack, or your framework’s own CLI.
- A framework version the package supports, listed in the table below.
@atatus/browser-rum, they do not replace it.
Choose your package
Install the package that matches your framework, alongside the base agent:The Next.js package needs 15.3 or later because it relies on the
instrumentation-client file convention, which earlier versions do not have. If you are on an older Next.js, use the React package and name views from your own navigation hook.Why view naming matters
Without a router integration, a view is named by the URL the user landed on. In an application with IDs in the path,/accounts/8f21/orders/4417 and /accounts/6b02/orders/9910 look like two unrelated pages, and neither has enough traffic to show a trend.
With the router integration, both report as /accounts/:accountId/orders/:orderId, so they aggregate into one view you can measure.
React
The React package names views from your route tree and reports render errors through an error boundary.1. Install the package
Install it alongside the base agent:2. Initialize the agent with the plugin
AddreactPlugin to plugins where you initialize the agent, before your app renders:
3. Import your router from the plugin
Withrouter: true, import the router pieces from the plugin instead of from React Router. Pick the entry that matches your router:
For a data router, swap the router factory:
Routes component and leave your <Route> elements alone:
createHashRouter, createMemoryRouter, and useRoutes. The TanStack entry exports createRouter:
The v6 entry re-exports from
react-router-dom, while the v7 and v8 entries re-export from react-router. Match the entry to the package your application already depends on.4. Catch render errors
Wrap the part of your tree you want protected inErrorBoundary. It reports the error with its component stack, then renders your fallback:
addReactError:
Angular
The Angular package names views from the matched route and replaces Angular’s error handler with one that reports to Atatus.1. Install the package
Install it alongside the base agent:2. Initialize the agent with the plugin
Initialize the agent before you bootstrap the application, usually inmain.ts:
3. Track route changes
AddprovideAtatusRouter() to your providers. For a standalone application:
4. Report component errors
AddprovideAtatusErrorHandler() to report errors Angular would otherwise only log to the console. It keeps the default console.error behavior:
ErrorHandler, keep it and call addAngularError from inside:
Vue
The Vue package names views from Vue Router and reports component errors with their component stack.1. Install the package
Install it alongside the base agent:2. Initialize the agent with the plugin
Initialize the agent inmain.ts or main.js:
3. Create your router with the Atatus wrapper
ImportcreateRouter from the plugin’s router entry instead of from vue-router, and keep the rest of your router options unchanged:
4. Attach the error handler
UseaddVueError as your application’s global error handler, then mount:
Next.js
The Next.js package supports both the App Router and the Pages Router. It always tracks views itself, so you do not set arouter option.
1. Install the package
Install it alongside the base agent:2. Create an instrumentation client file
Createinstrumentation-client.js in the root of your project. Next.js loads it before your application code runs:
Re-exporting
onRouterTransitionStart is required for the App Router. Next.js calls it when a navigation starts, which is how the agent captures the destination URL before React renders. The Pages Router does not need it, so you can drop that line in a Pages Router application.3. Add the router component
For the App Router, renderAtatusAppRouter in your root layout:
AtatusPagesRouter in your custom App:
4. Report errors
The App Router catches uncaught exceptions inerror.tsx files. Report from there with addNextjsError:
app/global-error.tsx. That file replaces the root layout, so it has to render its own <html> and <body> tags.
A Server Component error reaches the browser as a generic message with an
error.digest hash attached. Use that hash to match the RUM error to the full stack trace in your server logs. Client Component errors arrive with their original message and no digest.ErrorBoundary instead:
Nuxt
The Nuxt package tracks file-based routes and reports errors from both Vue’s error handler and Nuxt’sapp:error hook.
1. Install the package
Install it alongside the base agent:2. Create a client-side plugin
Createplugins/atatus-rum.client.ts and initialize the agent there, passing the router and the Nuxt app:
.client.ts suffix keeps the plugin out of the server bundle, and enforce: 'pre' runs it before your other plugins so it can catch startup errors.
3. Report errors you handle yourself
UseaddNuxtError anywhere you catch an error you still want recorded:
Any other framework
There is no package for Svelte, Solid, Ember, or a hand-rolled router, so name views yourself from your router’s navigation hook. UsesetViewName, which renames the view the agent already created:
Use
setViewName rather than startView here. The agent already creates a view on each navigation, so calling startView as well produces two views for every route change. setViewName renames the existing one.Next steps
- Configuration: every initialization option.
- Error Tracking: source maps and manual error reporting.
- Session Replay: recording and privacy options.
- API Reference: methods you can call after
init().