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

@reinconsole/sdk

v0.1.1

Published

Rein guard SDK — wrap your agent's fetch once and every x402 payment is policy-checked, receipted, and observable before a cent moves.

Readme

@reinconsole/sdk

The demand-side guard of Rein — the control plane for AI agent payments. Wrap your agent's fetch once and every x402 payment is policy-checked, receipted, and observable before a cent moves. Non-custodial: Rein governs the authority to spend, never the funds.

Status: v0.1 — early open-source infrastructure, live on testnet. APIs may change before 1.0. See it running: Rein console.

Install

npm install @reinconsole/sdk
# and something to point it at:
npx -p @reinconsole/policy-engine rein-policy-engine   # the rule engine on :8787

Quickstart

import { createGuard } from '@reinconsole/sdk';

const guard = createGuard({
  engineUrl: 'http://localhost:8787', // @reinconsole/policy-engine (or the durable variant)
  agentId,                            // registered with the engine
});

const fetch = guard.wrap();

// Use it exactly like fetch. When a vendor answers 402:
//  - the guard turns the x402 requirement into a PaymentIntent,
//  - the policy engine evaluates it (budgets, tx caps, allow/deny lists, kill switch),
//  - a signed decision comes back — deny blocks BEFORE any payment exists,
//  - either way you get a Receipt.
const res = await fetch('https://api.vendor.example/answer');

How it behaves

  • 402 intercept. The guard wraps the base fetch, underneath any x402 payment library. A blocked paywall never reaches the payment layer; an allowed one flows through, and the payment layer's X-PAYMENT retry is attached to the same receipt.
  • Or let it pay. Pass a payer (e.g. the EIP-3009 payer from @reinconsole/x402-rails) and the guard settles allowed payments itself — evaluate → pay → retry, one call.
  • Blocked, your way. onBlocked: 'throw' (default) raises PaymentBlockedError; 'respond' returns a synthetic 402 JSON response for agent loops that inspect instead of catch.
  • Task context. Attach taskContext (or scope it per call with withTask()) so every decision and receipt says why the agent was spending.
  • Receipts either way. Every paywall encounter — allowed, denied, settled — becomes a Receipt; stream them out with onReceipt.
  • x402 v1 wire + CAIP-2 ids. Speaks the hosted-facilitator dialect that x402.org still fully supports; network ids accept CAIP-2 forms.

SDK-mode is advisory + observability: an agent that holds its own key can bypass it — and the indexer flags that as shadow spend. The session-key signer tier (keys the agent never holds) is the GA enforcement architecture and lives in the monorepo.

MIT © Rein contributors · Repository · Issues