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

@replayos/node

v1.0.3

Published

The official Node.js SDK for ReplayOS. Automated OpenTelemetry tracing and incident observability.

Readme

@replayos/node

The official Node.js SDK for ReplayOS.

Zero-config OpenTelemetry tracing, dependency mapping, and incident observability for distributed microservices. Drop this into your application to instantly visualize request flows, database queries, and cascading failures in real-time.

npm version

Features

  • Zero-Config Instrumentation: Automatically hooks into Express, HTTP, Postgres, Redis, MongoDB, and dozens of other standard Node.js libraries.
  • Fail-Safe Design: Operates silently in the background. If your ReplayOS backend is unreachable, the SDK drops traces rather than crashing your production application.
  • Distributed Tracing: Automatically propagates context across microservice boundaries (HTTP headers) to build complete end-to-end trace graphs.

Installation

Install the SDK via npm:

npm install @replayos/node

Quick Start

Initialize the SDK at the very top of your entry file (e.g., index.js or server.ts). This must run before you require any other dependencies.

const { ReplayOS } = require('@replayos/node');

ReplayOS.init({
    projectId: 'your-project-uuid', // Found in Project Settings
    ingestKey: 'your-ingest-key',   // Found in Project Settings
    serviceName: 'order-service'
});

API Reference

ReplayOS.init(options) Starts the auto-instrumentation engine and connection to the ReplayOS ingest gateway.

| Option | Type | Default | Description | | ----------- | ------- | --------------------------------------------------- | ----------------------------------- | | projectId | string | process.env.REPLAYOS_PROJECT_ID | Your Project ID. | | ingestKey | string | process.env.REPLAYOS_INGEST_KEY | Your secret Ingest Key. | | serviceName | string | process.env.REPLAYOS_SERVICE_NAME | Name for the dependency graph. | | ingestUrl | string | http://localhost:5000/... | Custom ingest endpoint. | | debug | boolean | false | Enables diagnostic console logging. |

ReplayOS.recordError(error)

Manually marks the currently active span as failed. Use this inside try/catch blocks to ensure handled exceptions appear in your ReplayOS Timeline.

try {
  await db.save();
} catch (err) {
  ReplayOS.recordError(err);
  throw err;
}

ReplayOS.getTracer()

Returns the underlying OpenTelemetry tracer. Use this to create manual spans for specific business logic not captured by auto-instrumentation.

ReplayOS.shutdown()

Returns a Promise that resolves once all pending traces are flushed to the server. Ideal for graceful shutdown sequences.

process.on('SIGTERM', async () => {
  await ReplayOS.shutdown();
  process.exit(0);
});

Environment Variables

For better security, you can omit credentials from your code and use environment variables:

REPLAYOS_PROJECT_ID
REPLAYOS_INGEST_KEY
REPLAYOS_SERVICE_NAME