npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@interfere/nest

v0.1.1

Published

NestJS SDK for Interfere. Auto-captures uncaught exceptions from controllers, providers, and middleware via a global ExceptionFilter, plus re-exports the @interfere/node OTel instrumentation.

Readme

@interfere/nest

NestJS SDK for Interfere. Auto-captures uncaught exceptions and creates per-request spans for controllers, guards, pipes, interceptors, and middleware.

Install

npm install @interfere/nest
# or
bun add @interfere/nest
# or
pnpm add @interfere/nest

Setup

The SDK uses two subpath imports to avoid loading @nestjs/* before instrumentation hooks are registered:

  • @interfere/nest/instrument — SDK init, error capture, span utilities (no @nestjs/* imports)
  • @interfere/nest/moduleInterfereModule and InterfereExceptionFilter (imports @nestjs/*)

1. Create instrument.ts

This file must be imported before any @nestjs/* module. It registers OTel instrumentation hooks that patch NestJS internals for automatic span creation.

// src/instrument.ts
import { init } from "@interfere/nest/instrument";

init({
  serviceName: "my-api",
  debug: true, // logs init status and exporter results to stdout
});

init() is synchronous and works in both ESM and CJS projects.

2. Import it first in main.ts

// src/main.ts
import "./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();

3. Register the module in app.module.ts

InterfereModule.forRoot() registers a global exception filter that captures 5xx errors and uncaught throws. 4xx responses (client errors) are not reported — they still produce OTel request spans but don't create error events.

// src/app.module.ts
import { Module } from "@nestjs/common";
import { InterfereModule } from "@interfere/nest/module";

@Module({ imports: [InterfereModule.forRoot()] })
export class AppModule {}

Build & Deploy

Install @interfere/cli as a dev dependency and add a postbuild script so source maps are uploaded and the release is registered with the collector. Without this step, the collector will reject spans from production deployments.

npm install -D @interfere/cli
{
  "scripts": {
    "build": "tsc",
    "postbuild": "interfere sourcemaps upload ./dist"
  }
}

The CLI derives the release slug from the same commit SHA the SDK uses at runtime (INTERFERE_SOURCE_ID, GITHUB_SHA, VERCEL_GIT_COMMIT_SHA, or git rev-parse HEAD). Both must see the same SHA for the slugs to match. See the @interfere/cli README for full options, Docker examples, and CI setup.

Environment Variables

| Variable | Where | Purpose | |---|---|---| | INTERFERE_PUBLIC_KEY | Runtime | Routes spans to your surface (interfere_pub_us_* or interfere_pub_eu_*) | | INTERFERE_API_KEY | CI / Build | Authenticates source map uploads and release registration (interfere_secret_us_* or interfere_secret_eu_*) | | INTERFERE_SOURCE_ID | Both | Override the commit SHA used to derive the release slug. Falls back to GITHUB_SHA, VERCEL_GIT_COMMIT_SHA, or git rev-parse HEAD. | | INTERFERE_DEBUG | Runtime | Set to 1 to enable debug logging without changing code. Equivalent to debug: true in init(). |

What gets captured

| Signal | When | Subpath | |---|---|---| | Request spans (middleware, guards, pipes, interceptors) | Every HTTP request | @interfere/nest/instrument | | Error events (5xx, uncaught throws) | Exceptions that reach the global filter | @interfere/nest/module | | Manual spans (withSpan, captureError) | Anywhere in your code | @interfere/nest/instrument |

Compatibility

  • NestJS 10.x and 11.x
  • Node.js >= 18.19.0
  • Works with Express (default) and Fastify adapters
  • CJS and ESM projects