Skip to main content

LogRocket Adapter

Send captured errors to LogRocket, which pairs them with session replay.

Install

yarn add logrocket

Activate

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

initialize();

await useAdapter('logrocket', {
appId: 'your-org/your-app',
});

Config

FieldPurpose
appIdYour LogRocket app id, in the org/app form (required).

The adapter dynamically imports logrocket, initializes it with your appId, and forwards each captured error so it is attached to the recorded session.

Notes

  • If logrocket is not installed, activation throws Failed to load LogRocket SDK… with the original import error preserved as cause.
  • Pair LogRocket with setUser() so replays are identified — the store forwards user context to adapters that support it.