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

@fretumai/express

v0.1.0

Published

Drop-in Fretum paymentMiddleware for x402-express — adds compliance, 0xSplits syndication, and dual Fretum + Agentic.Market listing with the same call signature as x402.

Readme

@fretumai/express

Drop-in Fretum paymentMiddleware for x402-express. Same signature as x402-express — adds compliance, 0xSplits syndication, and dual listing on the Fretum marketplace + Agentic.Market.

Installed as @fretumai/express — imports are from '@fretumai/express'.

Install

npm install @fretumai/express @fretumai/facilitator

Quick Start

import express from "express";
import { paymentMiddleware } from "@fretumai/express";
import { facilitator } from "@fretumai/facilitator";

const app = express();

app.use(paymentMiddleware(
  "0xYourMerchantPayoutAddress", // raw EOA is fine — auto-wrapped in 0xSplits
  {
    "POST /lead-research": {
      price: "$1.00",
      network: "base",
      config: {
        name: "Lead Research",
        description: "Dallas-area B2B prospect enrichment",
        discoverable: true,
        inputSchema: { /* JSON Schema */ },
        outputSchema: { /* JSON Schema */ },
      },
    },
  },
  { facilitator }
));

app.post("/lead-research", (req, res) => {
  // ...do the work...
  res.json({ leads: [] });
});

app.listen(3000);

What Fretum adds over plain x402-express

  1. 0xSplits auto-wrap — Pass a raw merchant EOA; we deploy (or resolve) an immutable 0xSplits contract that pays 98% to the merchant and 2% to the Fretum treasury, then hand that split address to x402 as payTo. No custody, no money-transmitter risk.
  2. Dual listing — Every discoverable: true route is mirrored to fretum.ai/marketplace and optionally syndicated to Coinbase's Agentic.Market. Devs get distribution without extra work.
  3. Graceful degradation — If the Fretum API is unreachable, the middleware falls through to raw x402-express behavior so your server never hard-fails on our outages.

Configuration

Environment variables:

FRETUM_API_BASE   default: https://api.fretum.ai
FRETUM_API_KEY    optional — required for listings/compliance

Or pass options directly:

paymentMiddleware(payTo, routes, {
  facilitator,
  fretumApiBase: "https://api.fretum.ai",
  fretumApiKey:  process.env.FRETUM_API_KEY,
  autoWrapSplit: true,   // default true
  syncListings:  true,   // default true
  merchantMetadata: { merchantId: "mcf-agentic" },
});

Advanced

import { fretumClient } from "@fretumai/express";

const client = fretumClient();
const split = await client.resolveSplit("0xMerchant", "base");

License

MIT — Cameron Fagan / MCF Agentic