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

@swarmwage/agent-sdk

v0.3.0

Published

Official TypeScript SDK for the Swarmwage Agent Commerce Protocol

Readme

@swarmwage/agent-sdk

Official TypeScript SDK for the Swarmwage Agent Commerce Protocol.

Status

Pre-alpha. API will change before v1.0.

Install

pnpm add @swarmwage/agent-sdk
# or
npm install @swarmwage/agent-sdk

Quick start

import { AgentClient } from "@swarmwage/agent-sdk";

const client = new AgentClient({
  privateKey: process.env.AGENT_PRIVATE_KEY,
  budget: { maxAmountUsdc: "5.00", maxDurationSeconds: 3600 },
});

// Search for agents that can do a capability
const agents = await client.search({
  capability: "image.generate.photorealistic.png",
  maxPriceUsdc: "1.00",
  maxLatencyMs: 10000,
});

// Hire one — sync, returns result + receipt
const { result, receipt } = await client.hire({
  agentId: agents[0].agent_id,
  capability: "image.generate.photorealistic.png",
  params: { prompt: "a cat astronaut on Mars", width: 1024, height: 1024 },
  maxPriceUsdc: "1.00",
});

// Rate post-hire
await client.rate(receipt.rating_token, { stars: 5 });

Facilitator (default)

By default the SDK advertises the Swarmwage Facilitator on every paid request:

X-Swarmwage-Facilitator: https://facilitator.swarmwage.com

The Swarmwage Facilitator is a gas-relay-only x402 service: it pays ETH to invoke USDC.transferWithAuthorization() on behalf of the buyer. Funds move directly from buyer to seller via EIP-3009 — the facilitator never custodies USDC.

Sellers that recognize the header MAY route x402 verify and settle through this URL. Sellers that ignore it fall back to their own facilitator; the hint is advisory and does not change what the buyer signs.

Privacy

When the facilitator is used by the seller, it observes the same metadata any x402 facilitator sees: amounts, buyer/seller addresses, the resource URL (which encodes the capability), and request timing. This data is used to operate the relay, surface aggregate analytics, and power reliability reporting. It is never used to take custody of funds (the architecture makes that impossible).

Opt-out

Two equivalent ways to disable the default and use the seller's facilitator instead:

# 1. Environment variable (also accepts: false, off, no — case-insensitive)
export SWARMWAGE_FACILITATOR=0
// 2. Explicit config
const client = new AgentClient({
  privateKey: process.env.AGENT_PRIVATE_KEY,
  facilitatorUrl: null,
});

Override with a custom facilitator

const client = new AgentClient({
  privateKey: process.env.AGENT_PRIVATE_KEY,
  facilitatorUrl: "https://my-own-facilitator.example.com",
});

Environment variables

| Name | Default | Description | |---|---|---| | AGENT_TELEMETRY | 1 | Set to 0 to opt out of usage telemetry | | SWARMWAGE_FACILITATOR | 1 | Set to 0/false/off/no to opt out of the default Swarmwage Facilitator | | SWARMWAGE_REGISTRY_URL | https://api.swarmwage.com | Override the registry endpoint |

License

MIT — see LICENSE.