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

@aiedx/fetchlens-next

v0.1.8

Published

AI bot detection middleware for Next.js — works on any host

Readme

@aiedx/fetchlens-next

AI bot detection middleware for Next.js. Detects 26 AI agents (GPTBot, ClaudeBot, PerplexityBot, and more) hitting your site in real-time. Works on any host — Vercel, AWS Amplify, Netlify, Cloudflare, self-hosted.

Why

Google Analytics, Plausible, and every other analytics tool are 100% blind to AI bot traffic. These bots don't run JavaScript, so they never appear in your dashboards. FetchLens detects them at the middleware layer.

Install

npm install @aiedx/fetchlens-next

Setup

Create middleware.ts in your project root:

import { withFetchLens } from '@aiedx/fetchlens-next'

export const middleware = withFetchLens({
  siteId: 'yourdomain.com',
  apiEndpoint: 'https://fetchlens.ai',
  siteTag: 'fl_pub_your_key',
})

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

Get your Site Tag by scanning your domain at fetchlens.ai.

What it detects

| Provider | Bots | |----------|------| | OpenAI | GPTBot, ChatGPT-User, OAI-SearchBot | | Anthropic | ClaudeBot, Claude-SearchBot, Claude-User, Claude-Code, anthropic-ai | | Perplexity | PerplexityBot, Perplexity-User | | Google | Google-Extended, Google-CloudVertexBot | | Apple | Applebot-Extended | | Meta | meta-externalagent, meta-externalfetcher, FacebookBot | | Others | DuckAssistBot, MistralAI-User, Bytespider, cohere-ai, Amazonbot, PetalBot, Diffbot, PhindBot, YouBot, CCBot |

Features

  • Zero-latency — detection runs asynchronously via waitUntil, no impact on page load
  • Vulnerability scan blocking — automatically blocks probes for .php, /wp-admin, .env, etc. with a 403 (configurable)
  • Server-side only — no client bundle impact, works with all rendering modes (SSR, SSG, ISR)
  • 26 AI bot signatures — covers all major AI crawlers and training bots

Configuration

withFetchLens({
  siteId: 'yourdomain.com',        // Required: your domain
  apiEndpoint: 'https://fetchlens.ai', // Required: FetchLens API URL
  siteTag: 'fl_pub_xxx',           // Your Site Tag (from install guide)
  blockVulnScans: true,            // Block vulnerability probes (default: true)
})

How it works

  1. Every request passes through Next.js middleware
  2. FetchLens extracts the user agent, headers, and request metadata
  3. The payload is sent asynchronously to the FetchLens API (zero latency impact)
  4. The API identifies the bot using 26 known signatures + heuristic detection
  5. Results appear on your FetchLens dashboard

Requirements

  • Next.js 14+
  • Node.js 18+

License

Proprietary. Copyright (c) 2026 AIEDX Private Limited.