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-vercel

v0.1.0

Published

Vercel Edge Middleware that answers AI crawlers with x402 / MPP pay-per-crawl, for any Vercel project (static sites, Astro, SvelteKit, Vite, Nuxt, Remix...). Owner keeps 100%, no account, no custody.

Readme

@forgemeshlabs/pay-per-crawl-vercel

Vercel Edge Middleware that charges AI crawlers per page with x402 and MPP. Works in front of anything Vercel serves: a static site, Astro, SvelteKit, Vite, Nuxt, Remix, Hugo, Docusaurus. (Next.js projects: use @forgemeshlabs/pay-per-crawl-next, same engine.) Only Web APIs, DNS-over-HTTPS for search-engine verification. You keep 100%: no account, no custody.

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

middleware.js at the project root (next to package.json):

import { createPayPerCrawl } from "@forgemeshlabs/pay-per-crawl-vercel";
const ppc = createPayPerCrawl({ siteName: "My Site" }); // PAY_TO, PRICE_USD, MODE ... come from env; options win
export default ppc.middleware;
// Vercel needs `config` as a literal in this file; it cannot be re-exported.
export const config = { matcher: ["/((?!_vercel|favicon.ico).*)"] };

Then in the Vercel project settings → Environment Variables: PAY_TO = your wallet (0x address on Base), PRICE_USD = 0.01, MODE = monitor. Deploy. Watch the function logs for what bots would have paid, then set MODE=gate and redeploy to charge.

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.

The middleware also serves /.well-known/x402.json, /llms.txt and /agents.txt. Prefer Edge Functions for those? export default ppc.handlers.x402Json; in api/x402.js with a rewrite, or just let the middleware do it.

Notes

  • A pure static project needs a package.json for the dependency; vercel.json with "outputDirectory": "public" (or your folder) keeps the HTML where it was. See examples/vercel-static.
  • TRUST_HEADER defaults to x-forwarded-for and the right-most entry is used, which is the one Vercel appended. A client cannot forge a search-engine IP by prepending it.
  • Replay lock and rDNS cache are per-isolate memory; pass store (any {get, put, delete}, e.g. Vercel KV / Upstash) for a shared one. On serverless this is best effort; the on-chain nonce is the hard guard.
  • /_vercel/*, static assets and non-GET/HEAD requests pass free. Bugs and bad config fail open: the site never goes down because of the gate.
  • Edge Middleware runs on every matched request, including bots that never pay. Vercel's Edge Middleware invocations are metered on paid plans; the free Hobby plan has a generous allowance.

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.