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

fypay-proxy

v0.3.1

Published

Zero-code payment proxy sidecar for AgentPay protocol. Merchants run one command to monetize any HTTP API.

Readme

fypay-proxy

Zero-code payment proxy sidecar for AgentPay protocol.

Put fypay-proxy in front of any HTTP API — it handles quoting, authorization verification, capture, and void automatically. Your business code stays untouched.

Quick Start

# Install globally
npm install -g fypay-proxy

# Generate SM2 signing key
fypay-proxy keygen --out seller.key

# Create a pricing template (quote.json)
cat > quote.json <<EOF
{
  "seller_id": "sel:your_seller_id",
  "currency": "CNY",
  "authorized_amount": 0.01,
  "recipient": "acct:your_account",
  "key_id": "kid:xxx"
}
EOF

# Start the proxy in front of your API
fypay-proxy serve \
  --target http://127.0.0.1:3000 \
  --signing-key file:./seller.key \
  --quote-template ./quote.json \
  --seller-id sel:your_seller_id \
  --key-id kid:xxx

How It Works

Buyer Agent
    │
    ├─ No AgentPay-Authorization header
    │  └─ fypay-proxy returns 402 + AgentPay-Quote
    │     (your API is never called)
    │
    ├─ Invalid / expired authorization
    │  └─ fypay-proxy returns 403
    │     (your API is never called)
    │
    └─ Valid authorization
       └─ fypay-proxy forwards request to your API
          └─ 2xx → adds AgentPay-CaptureRequest header
          └─ non-2xx → issues void (refund)

Your business API has zero awareness of AgentPay — the proxy handles everything.

Commands

| Command | Description | |---------|-------------| | fypay-proxy serve [options] | Start the reverse proxy sidecar | | fypay-proxy keygen [options] | Generate SM2 key pair + key_id | | fypay-proxy quote-sign [options] | Debug tool: sign a Quote manually |

Serve Options

| Flag | Env Var | Default | Description | |------|---------|---------|-------------| | --target <url> | FYPAY_TARGET | — | Upstream API address (required) | | --listen <host:port> | FYPAY_LISTEN | 0.0.0.0:8080 | Public listen address | | --admin <host:port> | FYPAY_ADMIN_LISTEN | 127.0.0.1:9090 | Admin endpoint | | --mode <mode> | FYPAY_MODE | production | mock for local testing | | --seller-id <id> | FYPAY_SELLER_ID | — | Seller ID (required) | | --key-id <id> | FYPAY_KEY_ID | — | Key ID from keygen (required) | | --signing-key <src> | FYPAY_SIGNING_KEY | — | file:/path or env:VAR (required) | | --quote-template <file> | FYPAY_QUOTE_TEMPLATE | — | Quote JSON template (required) | | --platform-endpoint <url> | FYPAY_PLATFORM_ENDPOINT | — | AgentPay platform URL | | --void-policy <policy> | FYPAY_VOID_POLICY | non-2xx | When to void | | --log-level <level> | FYPAY_LOG_LEVEL | info | Log verbosity |

Mock Mode

Use --mode=mock for local development without a real AgentPay platform:

fypay-proxy serve --mode=mock --target http://127.0.0.1:3000 ...

# The admin endpoint provides a mock authorization signer:
curl -X POST http://127.0.0.1:9090/mock/sign-authorization \
  -H 'content-type: application/json' \
  -d '{"endpoint":"/api/data","method":"GET"}'

Requirements

  • Node.js >= 20

License

MIT