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

paygate

v5.0.0

Published

Accept payment from AI agents in two lines of code. Gate any Express or Fastify route with an x402 paywall backed by ArisPay — merchants don't hold keys, agents pay per-request, USDC settles in seconds on Base mainnet.

Readme

paygate

Create agent-payable offers with HTTP 402 and USDC settlement. PayGate handles the x402 challenge, calls the ArisPay facilitator, and lets your handler run only after payment settles.

API endpoint offers are live today. Use the hosted proxy for zero-code acceptance, or install this package when you want the 402 flow on your own domain.

Install

npm install paygate

Express

import express from 'express';
import { paygate } from 'paygate/express';

const app = express();

const pw = paygate({
  merchantId: process.env.PAYGATE_MERCHANT_ID,
});

// $0.10 per request
app.get('/api/data', pw({ priceCents: 10 }), (req, res) => {
  res.json({ data: 'premium content' });
});

// Dynamic pricing
app.post('/api/analyze', pw({
  priceCents: (req) => req.body.depth === 'deep' ? 50 : 10,
  description: 'AI analysis',
}), (req, res) => {
  res.json({ result: '...' });
});

app.listen(3000);

Fastify

import Fastify from 'fastify';
import paygate from 'paygate/fastify';

const app = Fastify();

await app.register(paygate, {
  merchantId: process.env.PAYGATE_MERCHANT_ID,
});

// Route-config-driven paywall
app.get('/api/data', {
  config: { paygate: { priceCents: 10 } },
}, async (req, reply) => {
  reply.send({ data: 'premium content' });
});

// Or imperative API
app.get('/api/research', async (req, reply) => {
  const { paid } = await req.paygatePay({
    priceCents: 5,
    description: 'Research query',
  });
  if (!paid) return; // 402 challenge already sent
  reply.send({ results: '...' });
});

await app.listen({ port: 3000 });

Hosted proxy

For a no-code merchant integration:

  1. Register at https://paygate.arispay.app/merchant-register.
  2. Add a primary USDC payout wallet in the PayGate dashboard.
  3. Create an API endpoint offer with method, path, targetUrl, and priceCents.
  4. Agents call https://paygate.arispay.app/{slug}{path}.

Example agent test:

npx payagent pay https://paygate.arispay.app/acme/forecast?city=London

API equivalent for offer creation:

curl -X POST https://api.arispay.app/v1/merchants/me/products \
  -H 'authorization: Bearer mp_live_…' \
  -H 'content-type: application/json' \
  -d '{
    "method": "GET",
    "path": "/forecast",
    "targetUrl": "https://api.acme.com/v1/forecast",
    "priceCents": 2,
    "description": "Weather forecast"
  }'

How it works

Agent                    Your API / Proxy       ArisPay Facilitator
  │                         │                        │
  ├─── GET /api/data ──────►│                        │
  │                         │  no X-Payment header   │
  │◄── 402 + requirements ──┤                        │
  │                         │                        │
  │   agent signs USDC transfer authorization        │
  │                         │                        │
  ├─── GET /api/data ──────►│                        │
  │    + X-Payment header   ├── POST /settle ────────►│
  │                         │                        │ verify + settle
  │                         │◄── { success, txHash } ─┤
  │◄── 200 + data ──────────┤                        │

The agent-side payagent CLI and SDK handle the 402 loop automatically.

Config

| Option | Required | Default | Description | |---|---|---|---| | merchantId | Yes | — | PayGate merchant ID from the dashboard. The SDK fetches payout rail, wallet, asset, facilitator, and trust policy from ArisPay. | | apiUrl | No | https://api.arispay.app | Override ArisPay API URL for staging/self-hosting. | | facilitatorUrl | No | Manifest value | Compatibility override. In v3, merchant capabilities are authoritative. | | timeout | No | 30000 | ArisPay/facilitator call timeout in ms. | | cacheTtlMs | No | 300000 | Merchant capability cache TTL. |

Compatibility mode

Older code that passes wallet and network still works through a v2 shim, but new integrations should use merchantId and configure payout wallets in the dashboard. The shim will be removed in a future major version.

Networks

PayGate currently settles USDC on EVM networks advertised by your merchant capability manifest. Base mainnet (eip155:8453) is the recommended production network.

License

MIT