This page lists every method on the two browser SDKs. Both are available as imports and as globals: atatusRum is window.ATATUS_RUM, and atatusLogs is window.ATATUS_LOGS.
Call any of these after init() has run.
Views
Views are created automatically on load and on route change. These methods let you name and annotate them:
| Method | Purpose |
|---|---|
startView(name) |
Start a new view. Needs trackViewsManually |
setViewName(name) |
Rename the current view without creating a new one |
setViewContext(context) |
Replace the current view's custom context |
setViewContextProperty(key, value) |
Set one property on the current view |
setViewLoadingTime() |
Mark the view as finished loading |
Use setViewName when a router integration is not available:
atatusRum.setViewName('/accounts/:accountId/orders');
Actions and resources
Clicks are collected for you when trackUserInteractions is on. These methods cover the work that is not a click:
| Method | Purpose |
|---|---|
addAction(name, context) |
Record a custom action that already happened |
startAction(name, options) |
Start a long-running action |
stopAction(name, options) |
Finish an action started with startAction |
startResource(url, options) |
Record a request the agent cannot see |
stopResource(url, options) |
Finish a manually started resource |
atatusRum.addAction('coupon-applied', { code: 'SPRING25' });
Errors and timing
| Method | Purpose |
|---|---|
addError(error, context) |
Report a handled error |
addTiming(name, time) |
Record a named timing against the current view |
addDurationVital(name, options) |
Record a completed duration |
startDurationVital(name, options) |
Start timing an operation |
stopDurationVital(name, options) |
Finish timing an operation |
Duration vitals measure work the browser cannot time for you, such as how long a chart took to render:
atatusRum.startDurationVital('chart-render');
renderChart(data);
atatusRum.stopDurationVital('chart-render');
Operations
Operations track a multi-step flow and whether it succeeded:
| Method | Purpose |
|---|---|
startOperation(name, options) |
Begin an operation |
succeedOperation(name, options) |
Mark it successful |
failOperation(name, reason, options) |
Mark it failed, with a reason |
startFeatureOperation(name, options) |
Begin a feature-scoped operation |
Identity
Set the user and account once they are known, and clear them on sign-out:
| Method | Purpose |
|---|---|
setUser(user) |
Set the signed-in user |
getUser() |
Read the current user |
setUserProperty(key, value) |
Set one property on the user |
removeUserProperty(key) |
Remove one property |
clearUser() |
Clear the user, on sign-out |
setAccount(account) |
Set the account or tenant |
getAccount() |
Read the current account |
setAccountProperty(key, value) |
Set one property on the account |
removeAccountProperty(key) |
Remove one property |
clearAccount() |
Clear the account |
atatusRum.setUser({
id: user.id,
name: user.fullName,
email: user.email,
role: user.role,
});
atatusRum.setAccount({ id: account.id, name: account.name });
id, name, and email are recognized fields. Any other key is kept as a custom attribute.
Set the user again whenever it changes, including on an account switch. The agent keeps whatever you last set, so a stale user stays attached to the rest of the session.
Context and feature flags
Global context is attached to every event:
| Method | Purpose |
|---|---|
setGlobalContext(context) |
Replace the global context |
getGlobalContext() |
Read the global context |
setGlobalContextProperty(key, value) |
Set one property |
removeGlobalContextProperty(key) |
Remove one property |
addFeatureFlagEvaluation(key, value) |
Report a feature flag value |
See Feature Flags for how flags are attached to events.
Session Replay
| Method | Purpose |
|---|---|
startSessionReplayRecording() |
Start recording |
stopSessionReplayRecording() |
Stop recording |
getSessionReplayLink() |
Get a link to the current session's replay |
See Session Replay for sampling and privacy.
Lifecycle and diagnostics
| Method | Purpose |
|---|---|
init(config) |
Initialize the agent |
getInitConfiguration() |
Read back the configuration you passed |
getInternalContext() |
Read the current session, view, and action IDs |
setTrackingConsent(consent) |
Switch consent between granted and not-granted |
getInternalContext() is the quickest way to confirm the agent is recording:
window.ATATUS_RUM.getInternalContext();
Logs API
atatusLogs has its own methods, alongside the same identity and context methods listed above:
| Method | Purpose |
|---|---|
logger |
The default logger |
createLogger(name, config) |
Create a named logger |
getLogger(name) |
Retrieve a named logger |
logger.setLevel(level) |
Set the minimum level to send |
setUser(user) |
Set the signed-in user |
setAccount(account) |
Set the account |
setGlobalContext(context) |
Replace the global context |
clearGlobalContext() |
Clear the global context |
getInitConfiguration() |
Read back the configuration |
getInternalContext() |
Read the current session context |
See Logs for levels and usage.
+1-415-800-4104