Skip to main content

Bugsnag Adapter

Send captured errors to Bugsnag.

Install

yarn add @bugsnag/js

Activate

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

initialize();

await useAdapter('bugsnag', {
apiKey: 'your-api-key',
releaseStage: 'production',
});

Config

FieldPurpose
apiKeyYour Bugsnag API key (required).
releaseStageEnvironment label (e.g. production, staging).

The adapter dynamically imports @bugsnag/js, starts it with your config, and forwards each captured error.

Notes

  • If @bugsnag/js is not installed, activation throws Failed to load Bugsnag SDK… with the original import error preserved as cause.
  • Pass any additional Bugsnag start options your project needs in the same config object.