@interfere/nest connects your NestJS backend to Interfere. Once it’s wired in, unhandled exceptions across your controllers and providers are captured with full server-side stack traces, and you get manual capture and tracing when you want them.
Prerequisites
- A NestJS app
- Node.js
>= 20
Install
Setup
1
Start the SDK before Nest loads
Create
instrument.ts and call init(). This file must run before any @nestjs/* import so the SDK can instrument the runtime.src/instrument.ts
2
Import it first in your entry file
Make
instrument the very first import in main.ts, ahead of everything else.src/main.ts
3
Register the module
InterfereModule.forRoot() installs a global exception filter, so unhandled exceptions are captured automatically.src/app.module.ts
Throw an error from a route and it shows up in your workspace within seconds, already grouped and triaged.
Source maps and releases
A backend has no bundler plugin, so use the CLI to upload source maps and register each deploy as a release. Add apostbuild step:
package.json
INTERFERE_API_KEY.
Configuration
Pass options toinit(). Most apps only set serviceName.
string
default:"node-app"
The name your telemetry is grouped under. Give each process a distinct value (an API, a worker, a cron) when they share one public key.
string
Group related services under one product surface, for example
checkout across an API and its workers.string
Environment label such as
production or staging. Falls back to INTERFERE_ENVIRONMENT, then VERCEL_ENV, then NODE_ENV.boolean
default:"false"
Log lifecycle events to stdout. Also enabled by
INTERFERE_DEBUG=1.captureUncaughtException: false or captureUnhandledRejection: false to use your own.
Report a handled error
Unhandled exceptions are captured by the module’s filter. To report an error you catch yourself, or to trace a specific operation, import from@interfere/nest: