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

@agenttoll/sdk

v1.5.2

Published

One-line micropayment integration for AI agents - Express, Cloudflare Workers, Vercel Edge, MCP, Browser

Readme

AgentToll SDK

One-line micropayment integration for AI agents.

Installation

npm install @agenttoll/sdk

Quick Start

1. Get Your API Key

The fastest way — one command, writes your .env automatically:

npx agenttoll init

This will:

  • Generate or accept your Solana / Base wallet
  • Register your project and create an API key
  • Configure pricing, access mode, and duration
  • Write AGENTTOLL_KEY=pk_... to your .env

Options:

npx agenttoll init                                  # Interactive setup
npx agenttoll init <WALLET>                          # Quick (auto-detect chain)
npx agenttoll init --solana <ADDR> --base <0xADDR>   # Both wallets
npx agenttoll init -y --solana <ADDR>                # Non-interactive (defaults)

Or register manually:

const response = await fetch('https://www.agenttoll.xyz/api/publisher/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'My API',
    wallet_address: 'YourSolanaWallet'
  })
});
const { api_key } = await response.json();

Or use the web dashboard at www.agenttoll.xyz/dashboard

2. Add to Your Server

import tollbooth from '@agenttoll/sdk';

// Toll all agents, let humans through free
app.use(tollbooth(process.env.AGENTTOLL_KEY, {
  amount: 0.05,         // USDC per request
  freeForHumans: true   // Browsers pass free
}));

// Or use the convenience method
app.use(tollbooth.agentsOnly(process.env.AGENTTOLL_KEY));

SDK Options

tollbooth(apiKey, {
  amount: 0.05,            // USDC to charge (default: 0.05)
  freeForHumans: false,    // Let browsers through free
  paths: ['*'],            // Routes to toll (glob patterns)
  walletAddress: null,     // Override default wallet
  bypassHeader: null       // Header for internal bypass
});

Convenience Methods

// Toll only AI agents
tollbooth.agentsOnly(apiKey, options)

// Protect single route
tollbooth.protect(apiKey, options)

// Check if paid
tollbooth.hasPaid(req)  // boolean

// Check if AI agent
tollbooth.isAgent(req)  // boolean

Cloudflare Workers / Edge

import { tollgate } from '@agenttoll/sdk/edge';

export default tollgate(PUBLISHER_KEY, { amount: 0.01 });

Content Gate (HTML Pages)

Protect HTML pages from agentic crawlers (Perplexity, SearchGPT, etc.):

import { contentGate, generateRobotsTxt } from '@agenttoll/sdk/content-gate';

// Serve gated HTML — real browsers pass, agents get 402
app.use(contentGate(PUBLISHER_KEY, { amount: 0.05 }));

// Auto-generate robots.txt with x402 payment signals
app.get('/robots.txt', (req, res) => {
  res.type('text/plain').send(generateRobotsTxt({ publisherKey: PUBLISHER_KEY }));
});

Browser Gate (Client-Side)

Detect headless/agentic browsers (Puppeteer, Playwright, Selenium) on the client:

<script src="https://www.agenttoll.xyz/js/browser-gate.js"
        data-publisher-key="YOUR_KEY"
        data-amount="0.05">
</script>

Detects: navigator.webdriver, HeadlessChrome, Selenium markers, Playwright markers, CDP indicators, missing plugins, and 15+ other signals.

MCP Payment Proxy

Paywall any MCP server without modifying it:

# Register your MCP server
curl -X POST https://www.agenttoll.xyz/api/mcp/register \
  -H "X-Publisher-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"upstream_url": "http://localhost:8080/mcp", "name": "My MCP Server"}'

Then point agents to the proxy URL. Free methods (tools/list, initialize) pass through; paid methods return 402 with payment instructions.

Full Documentation

See www.agenttoll.xyz/docs