Skip to main content

Rollbar Adapter

Send captured errors to Rollbar.

Install

yarn add rollbar

Activate

import { initialize, useAdapter } from 'unified-error-handling';

initialize();

await useAdapter('rollbar', {
accessToken: 'your-post-client-item-access-token',
environment: 'production',
});

Config

FieldPurpose
accessTokenYour Rollbar post_client_item access token (required).
environmentEnvironment label.

The adapter dynamically imports rollbar, initializes it with your config, and forwards each captured error.

Notes

  • If rollbar is not installed, activation throws Failed to load Rollbar SDK… with the original import error preserved as cause.
  • Use a client-side (post_client_item) token, not a server token, in browser code.