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

@outray/nest

v0.0.5

Published

NestJS tunnels and OpenTelemetry observability for OutRay

Readme

@outray/nest

NestJS integration for Outray, the open-source tunneling solution. Automatically expose your local NestJS server to the internet during development.

Installation

npm install @outray/nest
# or
pnpm add @outray/nest
# or
yarn add @outray/nest

Usage

Import the outray function and call it in your main.ts file after your application starts listening.

import { NestFactory } from "@nestjs/core";
import { AppModule } from "./app.module";
import { outray } from "@outray/nest";

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // Start the server
  await app.listen(3000);

  // Start the tunnel in development
  if (process.env.NODE_ENV !== "production") {
    await outray(app);
  }
}
bootstrap();

Observability

Register telemetry in code before app.listen(). No NODE_OPTIONS preloader or OpenTelemetry environment-variable names are required. Request tracing and payload capture currently support Nest's Express adapter:

import { NestFactory } from "@nestjs/core";
import { outray, registerOutrayObservability } from "@outray/nest";

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const telemetry = registerOutrayObservability(app, {
    apiKey: "outray_your_observability_token",
    serviceName: "orders-api",
    environment: "production",
    captureConsole: true,
    capturePayloads: {
      maxBodyBytes: 16 * 1024,
      redactedHeaders: ["x-workspace-secret"],
      redactedFields: ["accountPin"],
    },
  });

  if (telemetry) telemetry.info("orders API started");

  await app.listen(3000);
  await outray(app); // The development tunnel remains a separate concern.
}

Pass the token directly as shown, but do not commit a real token to source control. Production code can supply the same apiKey option from any server-only secret provider. Telemetry remains active in production when the development tunnel is disabled. Late registration and non-Express request instrumentation are skipped with a warning instead of affecting the application.

Every instrumented request records http.server.request.count, http.server.request.duration, and http.server.active_requests. Successful registration returns the same structured logging object used by the other OutRay SDKs. Use withOutraySpan from @outray/nest for application operations that need a child span inside the current request trace.

captureConsole: true also sends existing console.debug, console.info, console.log, console.warn, and console.error calls while preserving their normal local output.

Only JSON, application/*+json, and URL-encoded form bodies are eligible. Authorization, cookies, tokens, passwords, secrets, and API/private keys are redacted. Bodies default to 16 KiB (hard limit 64 KiB) and serialized headers default to 8 KiB (hard limit 32 KiB). Multipart, text, XML, binary, compressed, and streaming bodies are not captured.

Configuration

You can pass options to the outray function:

await outray(app, {
  // Optional: Explicitly specify port (auto-detected otherwise)
  port: 3000,

  // Optional: Request a specific subdomain
  subdomain: "my-cool-app",

  // Optional: Use a custom domain
  customDomain: "api.example.com",

  // Optional: Suppress console output
  silent: false,
});

Options Reference

| Option | Type | Default | Description | | ----------------- | -------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------- | | port | number | Auto-detected | The local port your NestJS app is running on. | | subdomain | string | Random | Request a specific subdomain. | | apiKey | string | process.env.OUTRAY_API_KEY | Your Outray API key. | | enabled | boolean | true (in dev) | Whether to enable the tunnel. | | silent | boolean | false | specific to Console logs. | | capturePayloads | boolean \| HttpPayloadCaptureOptions | false | Register opt-in payload capture before the app is initialized. Prefer registerOutrayPayloadCapture. | | onTunnelReady | (url: string) => void | - | Callback when tunnel is ready. |

License

MIT