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

@analytickit/sdk-node

v0.1.1

Published

Server-side event tracking + request middleware for the AgentGraph / AnalyticKit API. Captures AI crawlers and agents (GPTBot, ClaudeBot, MCP, x402, ...) that never run browser JS.

Readme

@analytickit/sdk-node

Status: published. npm install @analytickit/sdk-node

Node client for AgentGraph. Two things live in this package:

  1. A plain track()/trackBatch() client — for an AI agent, job, or backend service that wants to emit its own events.
  2. Request middleware (trackRequest() plus three framework adapters) that turns any Node server into a server-side event collector, so traffic that never runs the browser SDK's JavaScript — AI crawlers in particular — still produces events.

Full install guide and the F0.3 access-log import mapping: docs/help/server-side-collection.md.

Install

npm install @analytickit/sdk-node

(Inside this monorepo, import it as @analytickit/sdk-node from any workspace, no install step needed.)

Client

import { AnalyticKit } from '@analytickit/sdk-node';

const client = new AnalyticKit({
  apiKey: process.env.ANALYTICKIT_SDK_KEY!,
  endpoint: 'https://app.analytickit.com', // bare origin — no trailing /v1
  // actorType: 'human' (default) | 'ai_agent' | 'cli' | ...
  // maxRetries: 2 (default) — only retries 5xx and network errors, never 4xx
  // timeout: 5000 (default, ms)
});

track(eventName, options?)

await client.track('report_generated', {
  actorType: 'ai_agent',
  agentId: 'agent_123',
  taskId: 'task_456',
  properties: { reportType: 'weekly_summary' },
});

trackBatch(events)

const { accepted, rejected } = await client.trackBatch([
  { eventName: 'agent_step', taskId: 't1' },
  { eventName: 'agent_step', taskId: 't1' },
]);

trackRequest(context, options?)

Records one inbound HTTP request as observed by a server-side collector. Normally you don't call this directly — the middleware adapters below call it for you — but it's the primitive they're built on, useful for a custom collector (e.g. one that wants to attach a response status):

await client.trackRequest(
  { userAgent, ip, path, referrer, host, method, status },
  { eventName: 'page_view', visitorId, sessionId },
);

request_context on the sent payload takes priority over ingest's own transport headers for Web2 enrichment — see the install guide, §3.

Middleware adapters

All three are re-exported from the package root (as well as from @analytickit/sdk-node/middleware):

import {
  analyticKitExpress,
  analyticKitFastify,
  analyticKitFetch,
  extractContext,
  shouldCollect,
  DEFAULT_IGNORE,
} from '@analytickit/sdk-node';

| Export | For | | --- | --- | | analyticKitExpress(options) | app.use(...) | | analyticKitFastify(options) | app.addHook('onRequest', ...) | | analyticKitFetch(options) | Next.js middleware, Hono, edge runtimes — anything handed a Fetch API Request | | extractContext(req, options?) | Pull a RequestContext off a node-style request object directly | | shouldCollect(path, options) | The ignore/sample-rate decision, exposed standalone | | DEFAULT_IGNORE | The default ignore regex list (static assets, health checks, _next, favicon) |

All three take MiddlewareOptions — at minimum { client }. See the install guide for ignore, sampleRate, trustProxy, and onError, and for why collection adds no request latency and cannot fail the request.

Full docs, the privacy/capture_ip behavior, volume-control gotchas, and the F0.3 CSV access-log import mapping: docs/help/server-side-collection.md.