Skip to main content

Unified Error Handling Docs

Zero-dependency error handling with dynamic adapter loading — one API for Sentry, Firebase, Datadog, Bugsnag, Rollbar, LogRocket, Raygun, AppCenter, and your own service.

One API, many services

Route errors to Sentry, Firebase Crashlytics, Datadog, Bugsnag, Rollbar, LogRocket, Raygun, AppCenter, a built-in console adapter, or your own backend — all behind the same captureError() call.

Zero dependencies

The core ships with no production dependencies. Each service SDK is loaded with a dynamic import() only when you call useAdapter() for it, so the SDKs you never use never reach your bundle.

Provider-less store

A singleton store (no React context, no wrapper component) means you can capture errors from any module — a util, a worker, a Vue component, or plain JavaScript — not just inside the React tree.

Rich context built in

Automatic device info, user context, tags, extra data, and a rolling breadcrumb trail. A beforeSend hook lets you filter or scrub any error before it leaves the browser.

Offline & interceptors

Errors raised while offline are queued and flushed when the connection returns. Optional interceptors capture console.error and failed fetch/XHR requests; global handlers catch uncaught errors and rejections.

Optional React layer

A separate unified-error-handling/react entry adds an ErrorBoundary, a withErrorBoundary HOC, and hooks (useErrorHandler, useAsyncOperation, and more). React is an optional peer — the core never imports it.

Built and maintained by Ahsan Mahmood LinkedIn · GitHub · npm