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

@kujolang/commerce

v0.5.0

Published

Provider-agnostic commerce for static sites with first-class Kujo SSG integration

Downloads

172

Readme

Kujo Commerce

Version License Kujo SSG

Add product catalogs, hosted checkout, carts, and verified payment events to static or dynamic sites. Start with ordinary purchase links. Add a runtime, durable storage, and payment operations when your site needs them.

Commerce works with Kujo SSG and other site generators. It keeps payment code outside the SSG and leaves payments, tax, inventory, and settlement with your provider.

Quick start

Requires Node.js 20 or later.

npm install @kujolang/commerce
npx kujo-commerce init --site .
npx kujo-commerce validate --site .
npx kujo-commerce build --site . --ssg vendor/ssg/build.kujo
npx kujo-commerce doctor --site .

Set --ssg to your Kujo SSG build script. The initializer creates a Static Mode configuration: products use pre-created HTTPS checkout links, with no browser JavaScript or server required. Host the output on GitHub Pages or any static file host. See the Static Mode guide and hosted-link example.

Use init --mode hybrid for a cart or dynamic checkout. The browser sends SKU and quantity; the runtime resolves trusted product and provider data.

Other generators can use loadConfig(), loadProducts(), validateStore(), and buildStatic(). Add <kujo-buy-button sku="..."></kujo-buy-button>, <kujo-cart></kujo-cart>, or the documented data attributes to your templates. The browser components do not depend on SiteKit. See generic static integration.

Choose what to add

| Need | Commerce provides | | --- | --- | | Product pages | Validated products, variants, exact prices, a public catalog, and browser assets | | Simple purchases | Hosted checkout links with no runtime | | Dynamic checkout | A cart, provider-hosted checkout, and customer portals | | Payment events | Raw-body webhook verification and normalized events | | Reliable processing | Optional receipts, queues, leases, retries, dead letters, and replay | | Recurring payments | Consent records, idempotent operations, and provider-specific subscription actions | | Recovery | Provider-state lookups, bounded reconciliation, and drift reports | | Fulfillment integration | Signed billing events for your fulfillment or entitlement service |

Static builds need no database, queue, cloud SDK, or provider API call. Durable processing needs storage and workers supplied by your deployment; an optional PostgreSQL adapter and deployment example are included. In-memory stores are test fixtures.

Providers and release scope

Commerce includes adapters for Stripe, Polar, PayPal, Square, Paddle, Lemon Squeezy, Link, and Mock. Each declares its supported features. Run npx kujo-commerce providers --json for the capability list. Product and quantity restrictions are checked during builds, in the browser, and in the runtime.

The maintainer has confirmed working Square and Stripe integrations. Version 0.5.0 ships the core commerce tool and optional Square payment modules. That confirmation does not establish live acceptance of every adapter or optional feature. See the acceptance status for the tested boundaries and remaining checks.

Optional Square modules add owned orders, direct payments and refunds, embedded card tokenization, saved-card consent, subscriptions, invoices, and encrypted merchant connections. Sensitive card entry stays in Square's SDK; Commerce receives a transient token. Application fees, catalog/inventory integrations, Terminal, and reporting remain off by default. Enable them only after the relevant provider and deployment checks. See owned payments, merchant connections, and the owned-payment example.

Contracts and upgrades

The package remains pre-1.0. Its v1 wire contracts are frozen:

  • Catalog: kujo-commerce/v1
  • Cart: kujo-cart/v1
  • Events: kujo-commerce-event/v1
  • Money: integer minor units, ISO currency, and display text
  • Runtime: Web Platform Request, Response, fetch, and Web Crypto

Static and hosted-link users need no configuration changes for 0.5.0. Runtime and custom-adapter users should read the migration guide, compatibility policy, and changelog.

Documentation

Development

npm ci
npm run validate
npm run test:browser

Install Playwright's browsers before running browser tests. PostgreSQL tests need an isolated database set through COMMERCE_POSTGRES_URL. Provider Sandbox tests need separate test credentials and explicit opt-in for mutations; see the staging runbook.