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

create-x402-sessions-facilitator

v0.1.0

Published

Scaffold a ready-to-run x402-sessions facilitator service in one command. Copies the template, installs deps, generates + funds a testnet keypair, writes .env.

Downloads

23

Readme

create-x402-sessions-facilitator

Scaffold a ready-to-run x402-sessions facilitator service in one command.

npm create x402-sessions-facilitator@latest my-facilitator
cd my-facilitator
npm run dev

That's it. The scaffold:

  1. Copies a fresh facilitator template into ./my-facilitator
  2. Runs npm install for you
  3. Generates a fresh Stellar testnet keypair
  4. Funds the keypair via friendbot
  5. Writes .env with the signing secret pre-filled

By the time you cd in, you can npm run dev and the facilitator is live on http://localhost:4021.

What you get

A small Express + better-sqlite3 service implementing the x402 facilitator HTTP API plus the session scheme extension:

GET  /health                 — liveness + facilitator address
GET  /supported              — x402 spec: advertise scheme/network kinds
POST /verify                 — x402 spec: stateless session payload check
POST /settle                 — x402 spec: re-verify + debit + on-chain transfer_from
POST /sessions               — create a session from a signed approval tx hash
GET  /sessions/:id           — inspect session state (cap / spent / expiry)

The facilitator:

  • Verifies on-chain allowance(user, facilitator) when a session is created
  • Persists sessions atomically in sqlite (WAL mode)
  • Executes transfer_from(facilitator, user, recipient, amount) on every /settle
  • Rolls back sqlite debits if the on-chain call fails
  • Enforces a per-call amount policy (MAX_PER_CALL env var) as an off-chain safety rail on top of the SAC's on-chain cap + expiry

Options

npm create x402-sessions-facilitator@latest [target-dir] [options]

| Flag | What | |---|---| | --skip-install | Don't run npm install after copying the template | | --skip-fund | Don't friendbot the generated keypair (useful when offline or for pubnet setup) |

Pubnet usage

The scaffold generates a testnet keypair by default. For pubnet:

  1. Generate + fund a pubnet keypair yourself
  2. Edit .env:
    STELLAR_NETWORK=stellar:pubnet
    SOROBAN_RPC_URL=https://soroban-rpc.mainnet.stellar.gateway.fm
    NETWORK_PASSPHRASE=Public Global Stellar Network ; September 2015
    FACILITATOR_SECRET=<your funded pubnet secret>
    USDC_CONTRACT_ID=CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75
  3. Run npm run dev

Companion SDK

Pair the facilitator with the x402-sessions client SDK in your dapp / agent / resource server.

License

MIT