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

goatx402-sdk-server

v0.2.1

Published

GoatX402 Server SDK for Node.js - handles API authentication securely on the backend

Readme

goatx402-sdk-server

Server-side TypeScript SDK for GoatX402 payment integration. It signs authenticated API requests with your merchant credentials (HMAC with per-request nonce and replay protection), so the key and secret stay on your backend — never expose them to the frontend. Public endpoints such as getMerchant need no credentials.

Pair it with goatx402-sdk in the browser: this package creates the order, the frontend SDK pays it.

Install

npm install goatx402-sdk-server

Quick start

import { GoatX402Client } from 'goatx402-sdk-server'

const client = new GoatX402Client({
  baseUrl: 'https://api.goatx402.io',
  apiKey: process.env.GOATX402_API_KEY!,
  apiSecret: process.env.GOATX402_API_SECRET!,
})

// Create an order
const order = await client.createOrder({
  dappOrderId: 'my-order-123',
  chainId: 97,
  tokenSymbol: 'USDC',
  tokenContract: '0x...',
  fromAddress: userWalletAddress,
  amountWei: '1000000',
})

// Return the order to the frontend for payment
res.json(order)

API surface

| Method | Purpose | |--------|---------| | createOrder(params) | Create a payment order | | createOrderRaw(params) | Create an order and return the raw x402 402 Payment Required payload | | createCheckoutSession(params) | Create a hosted checkout session (DIRECT and DELEGATE flows) | | createDelegateCheckoutSession(params) | Deprecated DELEGATE-only wrapper, kept for compatibility | | getOrderStatus(orderId) | Fetch current order status and details | | getOrderProof(orderId) | Fetch the signed order proof | | submitCalldataSignature(orderId, signature) | Submit the buyer's EIP-712 calldata signature | | cancelOrder(orderId) | Cancel an order | | getMerchant(merchantId) | Fetch public merchant info (tokens, receiving config) | | waitForConfirmation(orderId, ...) | Poll until the order reaches a terminal state (confirmed, failed, expired, or cancelled) or polling times out |

Helpers: calculateSignature / signRequest (request signing), toCAIP2 / fromCAIP2 / parseX402Header (x402 header and chain-id utilities).

Requirements

Node.js >= 18.

Documentation

Release notes: CHANGELOG.md. Backend integration examples live in the repository's demo server (goatx402-demo).

License

MIT