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

@bbloker/sdk

v0.4.1

Published

AI bot blocker SDK — shared intelligence network to detect and block AI crawlers

Readme

bbloker

AI bot blocker SDK. Drop-in middleware that detects and blocks AI crawlers (GPTBot, ClaudeBot, Meta, Bytespider, etc.) from your web application.

Works with any framework. No infrastructure changes needed.

Install

npm install @bbloker/sdk

Quick Start

Next.js

// middleware.ts
import { createMiddleware } from "@bbloker/sdk/nextjs";

export default createMiddleware({
  apiKey: process.env.BBLOKER_API_KEY!,
});

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

Express

import express from "express";
import { createMiddleware } from "@bbloker/sdk/express";

const app = express();

app.use(
  createMiddleware({
    apiKey: process.env.BBLOKER_API_KEY!,
  }),
);

Hono (Cloudflare Workers / Deno / Bun)

import { Hono } from "hono";
import { createMiddleware } from "@bbloker/sdk/hono";

const app = new Hono();

app.use(
  "*",
  createMiddleware({
    apiKey: process.env.BBLOKER_API_KEY!,
  }),
);

Raw Node.js

import http from "node:http";
import { createHandler } from "@bbloker/sdk/node";

const guard = createHandler({
  apiKey: process.env.BBLOKER_API_KEY!,
});

const server = http.createServer((req, res) => {
  if (guard(req, res)) return; // blocked, response already sent
  res.end("Hello");
});

How It Works

  1. SDK intercepts every incoming request before your route handlers
  2. Extracts a fingerprint (UA, IP, headers, request pattern)
  3. Matches against local rule cache (ships with 40+ known bot signatures)
  4. Blocks or allows in < 1ms — no external API call in the hot path
  5. Async: sends anonymized fingerprints to bbloker cloud for shared intelligence
  6. Rules auto-update every 5 minutes from the bbloker API

What It Blocks

  • OpenAI (GPTBot, ChatGPT-User, OAI-SearchBot)
  • Anthropic (ClaudeBot, anthropic-ai)
  • Meta (Meta-ExternalAgent, FacebookBot, facebookexternalhit)
  • Bytedance (Bytespider)
  • Google AI training (Google-Extended)
  • Apple AI training (Applebot-Extended)
  • Perplexity, Cohere, Diffbot, Amazon, and 30+ more
  • Known bot IP ranges
  • Anomalous header patterns (missing Accept-Language, wrong header order)
  • Rate limit violations

Configuration

import { Bbloker } from "@bbloker/sdk";

const bbloker = new Bbloker({
  // Required
  apiKey: "bb-sk-...",

  // Optional
  apiUrl: "https://bbloker.com", // self-hosted API
  syncInterval: 300_000, // rule sync interval (5 min)
  flushInterval: 10_000, // telemetry flush interval (10s)
  bufferSize: 100, // max fingerprints before force flush
  telemetry: true, // send fingerprints to cloud
  rateLimit: 60, // max requests per IP per window
  rateLimitWindow: 60_000, // rate limit window (1 min)
  logLevel: "warn", // debug | info | warn | error | silent

  // Custom block handler
  onBlock: ({ fingerprint, decision }) => {
    console.log(`Blocked: ${fingerprint.ip} - ${decision.reason}`);
  },
});

Offline Mode

The SDK ships with a bundled rule set and works immediately without an API connection. The API key enables cloud features: real-time rule updates, shared threat intelligence, and the analytics dashboard.

License

APACHE-2.0 License. See LICENSE for details.