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

@adwait12345/telemetry-express

v0.1.3

Published

Express middleware for Telemetry SDK - track AI bots and crawlers

Readme

@adwait12345/telemetry-express

Express middleware adapter for the Telemetry SDK. Detects bots and crawlers on every incoming request and sends tracking payloads to the Telemetry API.


Requirements

  • Express 4.x or later
  • Node.js 18+ (uses native fetch)
  • A Telemetry account with a Project ID and Server Secret

Installation

npm install @adwait12345/telemetry-express @adwait12345/telemetry-core
# or
pnpm add @adwait12345/telemetry-express @adwait12345/telemetry-core

Setup

import express from "express";
import { telemetryMiddleware } from "@adwait12345/telemetry-express";

const app = express();

app.use(
  telemetryMiddleware({
    projectId: process.env.TELEMETRY_PROJECT_ID!,
    apiUrl: process.env.TELEMETRY_API_URL,
    serverSecret: process.env.TELEMETRY_SERVER_SECRET!,
    debug: false,
  })
);

app.get("/", (req, res) => {
  res.send("Hello world");
});

app.listen(3000);
# .env
TELEMETRY_PROJECT_ID=your-project-id
TELEMETRY_API_URL=https://telemetry-uqd3.onrender.com
TELEMETRY_SERVER_SECRET=sk_...

How it works

  1. The middleware runs synchronously on every request
  2. The request is normalized (UA, IP, headers, HTTP version) and passed to detectBot()
  3. Express exposes the real httpVersion from the raw request — this improves detection accuracy (HTTP/1.0 is flagged as a bot signal)
  4. If a bot is detected (or trackAll: true), a fire-and-forget send is triggered
  5. next() is called immediately — the send does not block the response

Configuration options

| Option | Type | Default | Description | |--------|------|---------|-------------| | projectId | string | required | Your Telemetry project ID | | serverSecret | string | required | Your server secret key for API auth | | apiUrl | string | hosted service | Override the API endpoint | | trackAll | boolean | false | Track all requests, not just bots | | trackSearchBots | boolean | true | Include Googlebot, Bingbot etc. | | ignorePaths | (string \| RegExp)[] | — | Paths to skip entirely | | customBots | Array<{name, pattern, category?}> | — | Add custom bot definitions | | debug | boolean | false | Log detection results to the console | | authorizationHeader | string | — | Fully custom Authorization header value | | headers | Record<string, string> | — | Extra headers on every telemetry request |


Examples

Skip health check and static routes

app.use(
  telemetryMiddleware({
    projectId: "...",
    serverSecret: "sk_...",
    ignorePaths: ["/health", "/ping", /^\/static\//],
  })
);

Track all visitors

app.use(
  telemetryMiddleware({
    projectId: "...",
    serverSecret: "sk_...",
    trackAll: true,
  })
);

Add custom bot definitions

app.use(
  telemetryMiddleware({
    projectId: "...",
    serverSecret: "sk_...",
    customBots: [
      { name: "MyInternalCrawler", pattern: /my-crawler\/\d+/i, category: "scraper" },
    ],
  })
);

What gets tracked

| Field | Description | |-------|-------------| | projectId | Your project ID | | path | Request path (from req.originalUrl) | | method | HTTP method | | userAgent | Full user-agent string | | ip | Client IP (from req.ip or x-forwarded-for) | | isBot | true / false | | botName | Named bot e.g. "GPTBot", or null | | botCategory | e.g. "ai-crawler", "search", "scraper" | | confidence | "certain" / "high" / "medium" / "low" | | detectionMethod | "ua-match" / "header-anomaly" / "http10" / "automation-header" | | referrer | Referrer header | | timestamp | ISO 8601 UTC |