Be among the first to integrate with the Universal Commerce Protocol. Join the waitlist and we'll notify you when ucp.js is ready.
Get up and running with ucp.js in minutes.
npm install ucp-handler @ucp/sdk zod@^3
# or with yarn
yarn add ucp-handler @ucp/sdk zod@^3
# or with pnpm
pnpm add ucp-handler @ucp/sdk zod@^3Built for developers who want to create robust, type-safe commerce integrations with minimal boilerplate.
Create UCP-compliant commerce endpoints with just a few lines of code.
import { createUcpHandler } from "ucp-handler";
import { z } from "zod";
const handler = createUcpHandler(
(commerce) => {
commerce.product(
"get_product",
"Retrieve product details",
{
productId: z.string(),
},
async ({ productId }) => {
const product = await fetchProduct(productId);
return {
content: [{
type: "product",
data: product,
schema: "https://schema.org/Product"
}],
};
}
);
},
{},
{ basePath: "/api/ucp" },
);
export { handler as GET, handler as POST };Universal Commerce Protocol is a Google-led initiative to standardize commerce data across the web, enabling seamless payments, product discovery, and shopping experiences.
Product catalogs, pricing, and inventory in a universal format.
Single integration for all payment methods and providers.
Connect to Google Shopping, marketplaces, and beyond.