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-nextjs

v0.2.2

Published

Drop-in Next.js route handlers that expose your Saleor storefront to AI shopping agents via UCP and ACP protocols.

Readme

@financedistrict/saleor-agentic-commerce-nextjs

Drop-in Next.js App Router route handlers that expose your Saleor storefront to AI shopping agents via UCP and ACP.

One config file, a few one-line route files, and your store is agent-ready. Zero runtime dependencies.

Part of the Saleor Agentic Commerce SDK.

Installation

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

Peer Dependencies

  • @financedistrict/saleor-agentic-commerce-core ^0.2.0
  • next >= 14.0.0

Quick Start

1. Create the config

// src/lib/agentic-commerce.ts
import { createAgenticCommerce, createUcpRoutes, createAcpRoutes } from "@financedistrict/saleor-agentic-commerce-nextjs"

const agenticCommerce = createAgenticCommerce({
  saleorApiUrl: process.env.NEXT_PUBLIC_SALEOR_API_URL!,
  saleorAuthToken: process.env.SALEOR_AGENTIC_AUTH_TOKEN!,
  storefrontUrl: process.env.NEXT_PUBLIC_STOREFRONT_URL!,
  storeName: process.env.SALEOR_AGENTIC_STORE_NAME!,
  channel: process.env.NEXT_PUBLIC_DEFAULT_CHANNEL,
  // paymentHandlers: [new PrismPaymentHandler({ ... })],
})

export const ucpRoutes = createUcpRoutes(agenticCommerce)
export const acpRoutes = createAcpRoutes(agenticCommerce)

2. Wire up route handlers

Each route file is a one-liner:

UCP Routes

src/app/api/ucp/
├── checkout-sessions/
│   ├── route.ts                    → POST (create)
│   └── [id]/
│       ├── route.ts                → GET (read), PUT (update)
│       ├── complete/route.ts       → POST
│       └── cancel/route.ts         → POST
└── orders/
    └── [id]/route.ts               → GET
// src/app/api/ucp/checkout-sessions/route.ts
import { ucpRoutes } from "@/lib/agentic-commerce"
export const { POST } = ucpRoutes.checkoutSessions

// src/app/api/ucp/checkout-sessions/[id]/route.ts
import { ucpRoutes } from "@/lib/agentic-commerce"
export const { GET, PUT } = ucpRoutes.checkoutSession

// src/app/api/ucp/checkout-sessions/[id]/complete/route.ts
import { ucpRoutes } from "@/lib/agentic-commerce"
export const { POST } = ucpRoutes.checkoutSessionComplete

// src/app/api/ucp/checkout-sessions/[id]/cancel/route.ts
import { ucpRoutes } from "@/lib/agentic-commerce"
export const { POST } = ucpRoutes.checkoutSessionCancel

// src/app/api/ucp/orders/[id]/route.ts
import { ucpRoutes } from "@/lib/agentic-commerce"
export const { GET } = ucpRoutes.order

ACP Routes

src/app/api/acp/
└── checkout_sessions/
    ├── route.ts                    → POST (create)
    └── [id]/
        ├── route.ts                → GET (read), POST (update)
        ├── complete/route.ts       → POST
        └── cancel/route.ts         → POST
// src/app/api/acp/checkout_sessions/route.ts
import { acpRoutes } from "@/lib/agentic-commerce"
export const { POST } = acpRoutes.checkoutSessions

// src/app/api/acp/checkout_sessions/[id]/route.ts
import { acpRoutes } from "@/lib/agentic-commerce"
export const { GET, POST } = acpRoutes.checkoutSession

// src/app/api/acp/checkout_sessions/[id]/complete/route.ts
import { acpRoutes } from "@/lib/agentic-commerce"
export const { POST } = acpRoutes.checkoutSessionComplete

// src/app/api/acp/checkout_sessions/[id]/cancel/route.ts
import { acpRoutes } from "@/lib/agentic-commerce"
export const { POST } = acpRoutes.checkoutSessionCancel

3. Verify

curl http://localhost:3000/.well-known/ucp

Configuration

createAgenticCommerce({
  // Required
  saleorApiUrl: string,        // Saleor GraphQL endpoint
  saleorAuthToken: string,     // App token (MANAGE_CHECKOUTS + MANAGE_ORDERS)
  storefrontUrl: string,       // Public storefront URL
  storeName: string,           // Store name for discovery profiles

  // Optional
  channel?: string,            // Saleor channel slug (default: "default-channel")
  storeDescription?: string,   // Store description for discovery
  ucpVersion?: string,         // UCP version (default: "2026-04-08")
  acpVersion?: string,         // ACP version (default: "2026-01-30")
  acpApiKey?: string,          // API key for ACP Bearer token auth
  paymentHandlers?: PaymentHandlerAdapter[],  // Payment handler adapters
})

Middleware

UCP header parsing utilities for custom route handling:

import { parseUcpHeaders, validateUcpHeaders } from "@financedistrict/saleor-agentic-commerce-nextjs/middleware/ucp-headers"

const headers = parseUcpHeaders(request)
// { agentProfile, requestId, idempotencyKey, contentDigest }

License

MIT