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
| Field | Purpose |
|---|---|
accessToken | Your Rollbar post_client_item access token (required). |
environment | Environment label. |
The adapter dynamically imports rollbar, initializes it with your config, and forwards each captured error.
Notes
- If
rollbaris not installed, activation throwsFailed to load Rollbar SDK…with the original import error preserved ascause. - Use a client-side (
post_client_item) token, not a server token, in browser code.