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

@forgemeshlabs/pay-per-crawl-next

v0.1.2

Published

Next.js middleware that answers AI crawlers with x402 / MPP pay-per-crawl. Edge-runtime compatible. Owner keeps 100%, no account, no custody.

Readme

@forgemeshlabs/pay-per-crawl-next

Next.js middleware that charges AI crawlers per page with x402 and MPP. Edge-runtime compatible (Web APIs only, DNS-over-HTTPS for search-engine verification). You keep 100%: no account, no custody.

npm install @forgemeshlabs/pay-per-crawl-next

middleware.js (Next 14/15):

import { createPayPerCrawl } from "@forgemeshlabs/pay-per-crawl-next";

const ppc = createPayPerCrawl({ siteName: "My Site" }); // PAY_TO, PRICE_USD, MODE ... come from env; options win
export const middleware = ppc.middleware;

// Next needs `config` as a literal in this file; it cannot be re-exported.
export const config = { matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"] };

Next 16 renamed middleware to proxy.js (Node runtime): export const proxy = ppc.proxy;. Both were built and tested (Next 15.5 edge middleware, Next 16.2 proxy).

Environment (all optional if passed as options): PAY_TO, PRICE_USD (min 0.005), MODE (monitor default, gate to charge), FACILITATOR_URL, CLASS_POLICY, BOT_OVERRIDES, ALLOW_PATHS, TRUST_HEADER, MPP_SECRET, PRO_KEY. Start in monitor.

The middleware also serves /.well-known/x402.json, /llms.txt and /agents.txt. Prefer route handlers? export const { GET } = ppc.handlers.x402Json; in app/.well-known/x402.json/route.js (and llmsTxt, agentsTxt).

Notes

  • TRUST_HEADER defaults to x-forwarded-for and the right-most entry is used (what your platform appended). On Vercel the platform sets it. If your server is exposed directly to the internet, set trustHeader: "" so a client cannot forge an IP.
  • Replay lock and rDNS cache are per-process memory by default; pass store (any {get, put, delete}) for a shared one across instances. On serverless this is best effort; the on-chain nonce is the hard guard.
  • Static assets, /_next/* and non-GET/HEAD requests pass free. Bugs and bad config fail open.
  • Example app: examples/next-app, built with next build and run with next start.

How money flows

Crawler signs a USDC authorization; the middleware has the facilitator (PayAI by default) verify and settle, and serves the page only on a settlement transaction hash. USDC lands in PAY_TO.

MIT.