@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.>= 201npm install @interfere/nest
instrument.ts and call init(). This file must run before any @nestjs/* import so the SDK can instrument the runtime.123import { init } from "@interfere/nest/instrument"; init({ serviceName: "my-api" });
instrument the very first import in main.ts, ahead of everything else.12345678910import "./instrument"; import { NestFactory } from "@nestjs/core"; import { AppModule } from "./app.module"; async function bootstrap() { const app = await NestFactory.create(AppModule); await app.listen(3000); } bootstrap();
InterfereModule.forRoot() installs a global exception filter, so unhandled exceptions are captured automatically.12345import { Module } from "@nestjs/common"; import { InterfereModule } from "@interfere/nest/module"; @Module({ imports: [InterfereModule.forRoot()] }) export class AppModule {}
postbuild step:123456{ "scripts": { "build": "nest build", "postbuild": "interfere sourcemaps upload ./dist" } }
INTERFERE_API_KEY.init(). Most apps only set serviceName.path serviceNamestringdefault: node-apppath serviceNamespacestringcheckout across an API and its workers.path environmentstringproduction or staging. Falls back to INTERFERE_ENVIRONMENT, then VERCEL_ENV, then NODE_ENV.path debugbooleandefault: falseINTERFERE_DEBUG=1.captureUncaughtException: false or captureUnhandledRejection: false to use your own.@interfere/nest:12345678910import { captureError, withSpan } from "@interfere/nest"; try { await chargeCard(); } catch (error) { captureError(error); throw error; } const order = await withSpan("checkout.submit", () => submitOrder(cart));
| Variable | Required | Description |
INTERFERE_PUBLIC_KEY | Yes | Your surface public key (interfere_pub_<region>_…). Routes telemetry to your project. |
INTERFERE_API_KEY | For releases | Used by the CLI to upload source maps (interfere_secret_<region>_…). A build-time secret; keep it in CI. |
INTERFERE_ENVIRONMENT | No | Labels this process's telemetry and releases (production, staging, or a label you choose). Falls back to VERCEL_ENV, then NODE_ENV, then development. Interfere drops the development, local, and test environments before ingestion, so set a real one to capture from it. |
INTERFERE_DEBUG | No | Set to 1 for lifecycle logs while setting up. |