Providers Overview
A provider is an error-tracking service reachable through an adapter. You activate one with useAdapter('<name>', config). The service SDK is loaded dynamically — install only the one(s) you use.
Capability matrix
| Provider | Adapter name | SDK to install | Notes |
|---|---|---|---|
| Console | console | — built-in | Logs to the console; ideal for development. |
| Custom | custom | — | Your own send callback (any backend). |
| Sentry | sentry | @sentry/browser | Errors, messages, breadcrumbs, user context. |
| Firebase Crashlytics | firebase | firebase | Firebase app + analytics events. |
| Datadog | datadog | @datadog/browser-rum + @datadog/browser-logs | RUM + Logs. |
| Bugsnag | bugsnag | @bugsnag/js | Error monitoring. |
| Rollbar | rollbar | rollbar | Error tracking. |
| LogRocket | logrocket | logrocket | Session replay + errors. |
| Raygun | raygun | raygun4js | Crash reporting. |
| AppCenter | appcenter | appcenter-crashes + appcenter-analytics | Mobile / React Native oriented. |
How activation works
import { useAdapter } from 'unified-error-handling';
await useAdapter('datadog', {
applicationId: 'your-app-id',
clientToken: 'your-client-token',
site: 'datadoghq.com',
});
Each provider page documents its config object. Activation:
- Dynamically imports the SDK (clear, actionable error if it is not installed — with the original failure preserved as
cause). - Initializes the SDK with your config.
- Makes the adapter active, replaying current context + breadcrumbs.
Honest notes
- One active adapter at a time. The last
useAdapter()wins; the store does not fan an error out to multiple services simultaneously. If you need that, capture into a custom adapter that forwards to several backends, or subscribe and re-dispatch. - You own the credentials. DSNs, client tokens, and API keys are passed by you and never bundled by the library.
- Optional methods vary. Some adapters implement
setContext,addBreadcrumb,flush, andclose; the store calls these only when the adapter provides them. - AppCenter is mobile-oriented. Its SDKs target React Native; on the web, prefer another adapter.