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

@clickport/agents

v0.1.0

Published

See which AI agents read your site. Server-side connector for Clickport's AI Agent Analytics: forwards request metadata, all classification happens server-side.

Readme

@clickport/agents

See which AI agents read your site. This is the server-side connector for Clickport's AI Agent Analytics.

AI assistants like ChatGPT, Claude and Perplexity fetch your pages without executing JavaScript, so no browser tracker can see them. This package observes requests on your server and forwards their metadata to Clickport, where every hit is classified and IP-verified. The connector itself never classifies anything, which means it never needs an update when new AI agents appear.

What it sends per request: timestamp, path, method, status, duration, and a fixed whitelist of request headers (user agent, referrer, IP forwarding headers, and bot-signature headers). Never cookies, never authorization headers, never request bodies.

Setup

You need a Clickport site and an agent key: Site settings, AI Agents, Generate key. Set it as CLICKPORT_AGENT_KEY in your environment, or pass { key } in the config.

Next.js

Create middleware.ts (Next 12.2 to 15) or proxy.ts (Next 16) at the project root:

import { withClickportAgents } from '@clickport/agents/next';

export default withClickportAgents({ key: process.env.CLICKPORT_AGENT_KEY });

export const config = {
  matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],
};

Already have middleware? Wrap it:

export default withClickportAgents({ key: process.env.CLICKPORT_AGENT_KEY }, myMiddleware);

Works on Vercel (including the Hobby plan), Netlify, and self-hosted. Delivery rides the platform's waitUntil, so it adds zero latency and is not lost when the serverless environment freezes after the response.

Honest limitation: middleware runs before your routes, so these reports carry no response status. A request that ends up a 404 is still counted as a fetch. If you need exact status codes, use the Express adapter (self-hosted) or wrap individual route handlers with withAgentTelemetry.

Express

import { clickportAgents } from '@clickport/agents/express';

app.use(clickportAgents({ key: process.env.CLICKPORT_AGENT_KEY }));

Full fidelity: real status codes and durations, only successful GET/HEAD content responses are reported. Lines are batched (20 lines or 5 seconds) and the queue is memory-bounded. For clean shutdowns:

import { flushAll } from '@clickport/agents/express';
process.on('SIGTERM', async () => { await flushAll(); process.exit(0); });

Plain node:http

import { instrument } from '@clickport/agents/node';

const server = createServer(handler);
instrument(server, { key: process.env.CLICKPORT_AGENT_KEY });

Verify it works

In your Clickport site settings, open AI Agents and click "Test my connector", or fetch any page of your site with:

curl -A "ClickportConnectorTest/1.0 (+https://clickport.io/docs/ai-agents)" https://your-site.com/

The connection status flips to connected within seconds.

Config

| Option | Default | Purpose | | --- | --- | --- | | key | CLICKPORT_AGENT_KEY env | Site API key with the agent-visits scope | | endpoint | Clickport production API | Override for testing | | exclude | none | Extra RegExp[] path patterns to skip | | flushAt | 20 | Batch size (Express/node adapters) | | flushIntervalMs | 5000 | Batch interval (Express/node adapters) | | onError | silent | Callback for failed deliveries |

Static assets, /_next/* internals, and non-GET/HEAD requests are always skipped. Reporting is wrapped so it can never break or slow your site.

License

MIT