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

@financedistrict/saleor-agentic-commerce-core

v0.2.2

Published

Make your Saleor store shoppable by AI agents. Core protocol types, formatters, and payment handler interface for UCP and ACP.

Readme

@financedistrict/saleor-agentic-commerce-core

Core library for exposing Saleor storefronts to AI shopping agents via UCP and ACP.

Provides protocol types, Saleor-to-protocol formatters, the payment handler adapter interface, and a lightweight Saleor GraphQL client. Framework-agnostic — no runtime dependencies.

Part of the Saleor Agentic Commerce SDK.

Installation

npm install @financedistrict/saleor-agentic-commerce-core

Most users should install this alongside @financedistrict/saleor-agentic-commerce-nextjs which provides ready-made route handlers. Use this package directly only if you're building a custom integration outside of Next.js.

What's included

Protocol Types

Full TypeScript types for both protocols, audited against the official specs:

  • UCP (2026-04-08) — UcpCheckoutSession, UcpOrder, UcpProfile, UcpPaymentInstrument, UcpFulfillment, and more
  • ACP (2026-01-30) — AcpCheckoutSession, AcpOrder, AcpCapabilities, AcpPaymentHandler, AcpFulfillmentOption, and more
import type { UcpCheckoutSession, AcpCheckoutSession } from "@financedistrict/saleor-agentic-commerce-core"

Formatters

Transform Saleor GraphQL responses into protocol-compliant shapes:

import {
  formatUcpCheckoutSession,
  formatUcpProfile,
  formatUcpOrder,
  formatAcpCheckoutSession,
} from "@financedistrict/saleor-agentic-commerce-core"

Saleor GraphQL Client

Lightweight client using raw fetch — no dependency on urql, Apollo, or graphql libraries:

import { SaleorClient } from "@financedistrict/saleor-agentic-commerce-core"

const client = new SaleorClient({
  apiUrl: "https://your-instance.saleor.cloud/graphql/",
  authToken: "your-app-token",
  channel: "default-channel",
})

const result = await client.getCheckout(checkoutId)

Payment Handler Interface

Pluggable adapter for any payment method:

import type { PaymentHandlerAdapter } from "@financedistrict/saleor-agentic-commerce-core"

class MyPaymentHandler implements PaymentHandlerAdapter {
  id = "com.example.my_payment"

  getUcpDiscoveryHandlers() { /* ... */ }
  getAcpDiscoveryHandlers() { /* ... */ }
  getUcpCheckoutHandlers(metadata?) { /* ... */ }
  getAcpCheckoutHandlers(metadata?) { /* ... */ }
  prepareCheckoutPayment(input) { /* ... */ }
  settlePayment(input) { /* ... */ }
}

Utilities

  • Address translationsaleorToUcpAddress(), ucpToSaleorAddress(), saleorToAcpAddress(), acpToSaleorAddress()
  • Status mappingresolveUcpCheckoutStatus(), resolveAcpCheckoutStatus()
  • Error formattingformatUcpError(), formatAcpError()
  • Metadata helpersmetadataToRecord(), recordToMetadataInput()

API Reference

Exports

| Export | Type | Description | |--------|------|-------------| | SaleorClient | class | GraphQL client for Saleor checkout/order operations | | PaymentHandlerRegistry | class | Registry for payment handler adapters | | formatUcpProfile | function | Format UCP discovery profile | | formatUcpCheckoutSession | function | Format Saleor checkout as UCP session | | formatUcpOrder | function | Format Saleor order as UCP order | | formatAcpCheckoutSession | function | Format Saleor checkout as ACP session | | formatUcpError / formatAcpError | function | Format protocol-compliant error responses | | saleorToUcpAddress / saleorToAcpAddress | function | Translate Saleor addresses to protocol format | | resolveUcpCheckoutStatus / resolveAcpCheckoutStatus | function | Map Saleor checkout state to protocol status | | toMinor | function | Convert decimal amounts to minor units (cents) |

License

MIT