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

@armory-sh/extensions

v0.1.18

Published

Armory x402 SDK — Protocol extensions for x402 payments. Add SIWX, payment ID, Bazaar discovery, and custom extensions.

Readme

@armory-sh/extensions

Armory x402 SDK — Protocol extensions for x402 payments. Add SIWX, payment ID, Bazaar discovery, and custom extensions.

Documentation | License

Installation

bun add @armory-sh/extensions

Why Armory?

Armory enables HTTP API payments via EIP-3009 transferWithAuthorization. Extensions add powerful functionality like authentication and idempotency.

API Reference

Hook Creators (Client-Side)

import {
  createSIWxHook,
  createPaymentIdHook,
  createCustomHook,

  // Types
  type SIWxHookConfig,
  type PaymentIdHookConfig,
  type CustomHookConfig,
} from '@armory-sh/extensions';

Server Extension Declaration

import {
  // Sign-In-With-X
  declareSIWxExtension,
  createSIWxMessage,
  createSIWxPayload,
  encodeSIWxHeader,
  parseSIWxHeader,
  validateSIWxMessage,
  verifySIWxSignature,
  isSIWxExtension,

  // Payment Identifier
  declarePaymentIdentifierExtension,
  extractPaymentIdentifierInfo,
  isPaymentIdentifierExtension,
  validatePaymentIdentifierExtension,

  // Bazaar Discovery
  declareDiscoveryExtension,
  createDiscoveryConfig,
  extractDiscoveryInfo,
  isDiscoveryExtension,
  validateDiscoveryExtension,

  // Types
  type SIWxExtensionConfig,
  type PaymentIdentifierConfig,
  type BazaarDiscoveryConfig,
  type SIWxPayload,
} from '@armory-sh/extensions';

Extension Utilities

import {
  // Generic Extension
  createExtension,
  extractExtension,
  validateExtension,

  // Payment ID Generation
  generatePaymentId,

  // Constants
  SIGN_IN_WITH_X,
  PAYMENT_IDENTIFIER,
  BAZAAR,

  // Types
  type Extension,
  type SIWxExtensionInfo,
  type PaymentIdentifierExtensionInfo,
  type BazaarExtensionInfo,
} from '@armory-sh/extensions';

Quick Start

Sign-In-With-X (SIWX)

Wallet authentication for repeat access.

import { createSIWxHook } from '@armory-sh/extensions'
import { createX402Client } from '@armory-sh/client-viem'

const client = createX402Client({
  wallet: { type: 'account', account },
  hooks: [
    createSIWxHook({
      domain: 'example.com',
      statement: 'Sign in to access premium content'
    })
  ]
})

Payment Identifier

Idempotency for payment requests.

import { createPaymentIdHook } from '@armory-sh/extensions'

const hook = createPaymentIdHook({ paymentId: 'my-custom-id' })

Custom Hooks

Create your own extensions.

import { createCustomHook } from '@armory-sh/extensions'

const customHook = createCustomHook({
  key: 'my-extension',
  handler: async (context) => {
    if (context.payload) {
      context.payload.extensions = {
        ...(context.payload.extensions ?? {}),
        'my-extension': { data: 'value' }
      }
    }
  },
  priority: 75
})

Server Extension Declaration

For server-side middleware:

import { declareSIWxExtension, declarePaymentIdentifierExtension } from '@armory-sh/extensions'

const siwxExt = declareSIWxExtension({
  domain: 'api.example.com',
  statement: 'Sign in to access this API'
})

const paymentIdExt = declarePaymentIdentifierExtension({ required: true })

Features

  • Sign-In-With-X: Wallet authentication for repeat access
  • Payment Identifier: Idempotency for payment requests
  • Custom Hooks: Create your own extensions
  • Server-Side: Declare extensions for middleware

License

MIT © Sawyer Cutler