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

goatflow-sdk-server

v0.3.0

Published

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

Readme

goatflow-sdk-server

Server-side TypeScript SDK for GOAT Flow 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 goatflow-sdk in the browser: this package creates the order, the frontend SDK pays it.

Install

npm install goatflow-sdk-server

Quick start

import { GoatFlowClient } from 'goatflow-sdk-server'

const client = new GoatFlowClient({
  baseUrl: 'https://flow-api.goat.network',
  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 payment record; signature is an unsigned hash of a subset of payload fields, not an attestation | | 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 or invoiced on success; failed, expired, or cancelled otherwise) or polling times out |

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

API failures throw the runtime-exported GoatFlowError class. Its code and status fields carry structured server details when available; authenticated request failures also retain the raw responseBody for diagnostics.

All requests have a 30-second hard deadline. waitForConfirmation additionally honors its overall timeout, retries transient failures, and immediately surfaces deterministic 4xx errors other than 408 and 429.

Requirements

Node.js >= 18.

Documentation

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

License

MIT