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

@cryptopayjs/sdk

v2.0.0-rc.1

Published

CryptoPay Checkout Widget & Node SDK — Accept crypto payments in minutes

Readme

cryptopay-js ? checkout session SDK

Version 2.0.0-rc.1, prepared locally for the CryptoPay v1 Sepolia pilot. This document does not imply that the RC has been published to npm.

The source of truth is crypto-pay/packages/sdk. Build and export from that repository:

npm run build:sdk
npm run export:sdk
npm --prefix ../cryptopay-js test

From this repository, npm pack produces a locally installable tarball. Its prepack check validates hashes, CJS/ESM imports and declaration files. provenance.json identifies the source commit and whether the source had uncommitted changes. Review and export a clean source commit before publishing a stable release. No unrelated npm scope is used.

Usage

Your backend authenticates to CryptoPay, fixes the order/amount and creates the payment. Return only its checkout session to the browser:

import { createCheckout } from 'cryptopay-js'

const checkout = createCheckout({
  baseUrl: 'https://YOUR_GATEWAY_HOST',
  paymentId: serverCreatedPayment.paymentId,
  checkoutToken: serverCreatedPayment.checkoutToken,
  onSuccess: () => refreshReservationFromYourBackend(),
  onError: message => console.error(message),
})
checkout.mount('#checkout')
// React effect cleanup:
// return () => checkout.unmount()

For a script tag, load your hosted dist/checkout.js and use CryptoPay.createCheckout(...). ESM is dist/checkout.mjs; CommonJS is dist/checkout.cjs; types are dist/index.d.ts. The old checkout.esm.js filename is refreshed as a compatibility artifact, but package exports use .mjs.

The QR encodes an ERC-20 transfer with chain and atomic amount. Wallet payments verify/switch chain and send the token transfer. A submitted hash does not trigger success: the SDK waits for server confirmation. onSuccess refreshes UI; only the merchant backend may apply business credits from verified events.

No API key, order price, private key or mnemonic belongs in this widget. The checkout token is scoped to reading one attempt. Use dynamic import or a client component when mounting inside Next.js. Importing the package on a server does not mount a widget.

Integration Examples & Documentation

Complete reference implementations and documentation are available in the examples/ directory:

  • Master Integration Guide — Comprehensive props, events, error codes catalog and compatibility matrix.
  • HTML & Vanilla JS Demo — Drop-in standalone script tag with embedded, modal, and hosted link flows.
  • React Demo — React 18/19 integration with ready-to-use <CryptoPayWidget />, headless useCryptoPaySession(), and modular components (<CryptoPayQRCode />, <CryptoPayStatusBadge />, <CryptoPayWalletButton />).
  • Next.js App Router Demo — SSR-safe client components, server-side route handlers, and secure webhook verification.
  • Generic Node.js Merchant Backend — Server-side authoritative pricing and idempotent webhook inbox.

Migration from v1

The old API-key/amount configuration and documented CryptoPayCheckout.init/open API are not supported by this RC. Replace them with a server-created session. CONTRACT, automatic payouts and refunds are not SDK features. The pilot supports DIRECT USDT on Sepolia; keep existing production checkout until the backend migration is accepted.