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

@agentbadge/pass-auth

v0.1.1

Published

Self-serve pass auth for AgentBadge marketplace services — verify wallet signatures + on-chain service passes on Arc, no calls to agentbadge.xyz

Downloads

388

Readme

@agentbadge/pass-auth

Self-serve pass auth for AgentBadge marketplace services. Protect your API/MCP with on-chain service passes in ~3 lines — on-chain reads only, zero calls to agentbadge.xyz in the request path.

Install

npm i @agentbadge/pass-auth viem

Hono

import { honoPassAuth } from "@agentbadge/pass-auth";

app.use("/api/*", honoPassAuth({
  serviceId: "0x…",            // your service's bytes32 id
  domain: "api.acme.com",      // challenge domain (your origin)
}));
// c.get("agentWallet") → authenticated buyer wallet

Express

import { expressPassAuth } from "@agentbadge/pass-auth";

app.use("/api", expressPassAuth({ serviceId, domain: "api.acme.com" }));
// req.agentWallet → authenticated buyer wallet

MCP (streamable HTTP)

Token exchange — clients can't sign per-request, so they exchange a wallet signature for a 1h bearer token:

import { mcpPassAuth } from "@agentbadge/pass-auth";

const mcp = mcpPassAuth({ serviceId, domain: "mcp.acme.com", secret: process.env.AUTH_SECRET });

app.post("/auth/token", async (req, res) => {
  const r = await mcp.handleTokenRequest(req.body); // {wallet, signature, timestamp}
  res.status(r.status).json(r.body);                // → {token, expiresIn}
});

// on your MCP endpoint:
const auth = mcp.verifyBearer(req.headers.authorization);
if (!auth) return res.status(401).end();

Buyer side

import { signChallenge } from "@agentbadge/pass-auth";

const { signature, timestamp, wallet } = await signChallenge(viemAccount, "api.acme.com");
// → headers: X-Agent-Wallet / X-Agent-Signature / X-Agent-Timestamp
// → or POST {wallet, signature, timestamp} to /auth/token for MCP

Status codes

| Code | Meaning | |------|---------| | 401 | missing/malformed/expired/invalid signature (300s replay window) | | 402 | valid signature, no live service pass → buy at the marketplace |

Config

{ serviceId, domain, rpcUrl?, nftAddress?, secret?, tokenTtlSeconds? }

Defaults: Arc Testnet (chainId 5042002), MarketplacePassNFT 0xb42f7c30e4dc14877dac7948bfcb2db455df2962, blockdaemon RPC. hasAccess results are cached 300s (15s for negatives — fresh purchases unlock quickly). clearAccessCache() for tests.

Signature verification covers EOA (local ecrecover), ERC-1271 contract wallets, and ERC-6492 counterfactual signatures via viem.