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

@clawcash/forge

v0.2.1

Published

ClawCash merchant SDK — outbound worker + fetch-handler fulfillment for the ClawCash gateway (zero runtime dependencies)

Downloads

105

Readme

@clawcash/forge

The fastest way to make an existing SaaS/API app agent-native.

Define a paid action on top of your backend and run an outbound worker that fulfills jobs from the ClawCash gateway. Agents discover, pay (x402/USDC), and call the gateway — your app adds no routes, no middleware, and no public agent surface. Zero runtime dependencies.

Published under the ClawCash npm org.

agent  ->  gateway.clawca.sh/<handle>/<action>   (x402)
               | job queued
worker ->  claims job (outbound long-poll), runs execute(), posts result
               |
agent  <-  result, same request

Install

npm install @clawcash/forge

Quick start (worker mode — the default)

One self-contained file. Your web server is not touched.

// src/forge/agent-worker.ts
import { defineAgentService, forgeWorker } from "@clawcash/forge";

const removeBackground = defineAgentService({
  name: "remove_background",
  description: "Remove the background from an image.",
  input: { imageUrl: "url" },
  output: { resultUrl: "url" },
  payment: { amount: "0.10", currency: "USDC", protocols: ["x402"] },
  async execute({ imageUrl }) {
    // call the API your product already has — loopback, hosted, or direct import
    const res = await fetch("http://127.0.0.1:3000/api/remove", {
      method: "POST",
      headers: { "content-type": "application/json" },
      body: JSON.stringify({ imageUrl }),
    });
    const data = await res.json();
    return { resultUrl: data.resultUrl };
  },
});

forgeWorker({ services: [removeBackground], handle: "my-app" });
FORGE_API_KEY=fk_live_... node --import tsx src/forge/agent-worker.ts
# [forge-worker] my-app polling https://gateway.clawca.sh/jobs/claim ...

Env: FORGE_API_KEY (required, from the Forge dashboard), FORGE_HANDLE (if not passed as an option), GATEWAY_URL (optional override).

The worker makes outbound requests only. It runs behind NAT, on localhost, in a private subnet — anywhere with outbound HTTPS. Polling doubles as the merchant heartbeat.

If the handle is not registered yet (claim returns 404), the worker keeps waiting — deploy first, then press Go live on the Forge dashboard. Only a bad FORGE_API_KEY (401) stops the worker.

Fetch-handler mode (inbound alternative)

For gateway-push deployments, createForgeHandler(services) returns a web-standard (Request) => Promise<Response> serving /forge/health, /forge/status, /.well-known/clawcash.json, and POST /forge/fulfill/{action} (gated by FORGE_API_KEY). Mounts natively in Next.js route handlers, Hono, Bun, Deno; createForgeRequestMatcher returns null on unmatched routes for fall-through mounting.

API

| Export | Purpose | |--------|---------| | defineAgentService | Declare name, schemas, payment, and execute | | forgeWorker | Outbound worker: claim paid jobs, execute, report results | | createForgeHandler / createForgeRequestMatcher | Web-standard inbound fulfillment surface | | validateInput / checkType | Schema validation | | waitUntil / context.waitUntil | Poll until a job completes inside execute | | getForgeApiKey / forgeGatewayLoopbackHeaders | Auth helpers for fulfillment traffic |

Build

npm install
npm run build