Skip to main content
@interfere/next connects browser errors, session replay, and server requests to the same surface. The build plugin uploads source maps so investigations can show your original code. You need a Next.js 16 or later App Router app, React 19, and Node.js 20 or later. Create a surface before starting; its keys connect this app to your workspace.

Setup

1

Install the package

2

Set your keys

Copy the keys from your surface into your deployment’s environment variables. Set both for builds; the runtime needs the public key.
Use production for your production deployment. Keep the secret key out of browser code. These variables do not need a NEXT_PUBLIC_ prefix.
3

Connect your build

Wrap your existing Next.js config. The plugin registers releases and uploads source maps during production builds.
next.config.ts
Keep withInterfere() outermost when composing config wrappers. See Releases and source maps if another tool also uploads source maps.
4

Start server and browser capture

Create instrumentation.ts in the project root, or inside src if your app uses a src directory.
instrumentation.ts
If you already initialize OpenTelemetry, follow OpenTelemetry composition instead of registering a second provider.Create instrumentation-client.ts beside instrumentation.ts. Next.js loads it before the app becomes interactive.
instrumentation-client.ts
5

Wrap your root layout

Wrap the root layout. The provider exposes identity and consent hooks and reports React render errors. Browser capture still requires the init() call above.
app/layout.tsx
Before recording customer sessions, set consent at initialization and review replay masking.

Verify capture

After initialization, report a test error from an existing button or event handler in your staging app:
Open your surface’s event chart to confirm that traffic arrives, then remove the test call.

Next steps

User tracking, report handled errors and trace custom work, or configure server telemetry and OpenTelemetry.