UCP SDK for JavaScript
npm install @ucp-js/sdk
Official JavaScript library for the Universal Commerce Protocol (UCP).
This repository contains the JavaScript SDK for the
Universal Commerce Protocol (UCP). It provides TypeScript
types and Zod schemas for UCP models, making it easy to
build UCP-compliant applications in JavaScript and TypeScript.
To install the SDK in your project, run:
``bash`
npm install @ucp-js/sdk
This project uses npm for package management and typescript for building.
The models are automatically generated from the JSON schemas in the UCP
Specification.
To regenerate the models, you first need a local copy of the UCP specification. If you don't have one, you can clone it via:
`bash`
git clone https://github.com/Universal-Commerce-Protocol/ucp.git
Then, run npm run generate pointing to the spec folder of the cloned
repository, e.g.:
`bash`
npm run generate -- ucp/spec
To build the project for both CommonJS and ESM:
`bash``
npm run build
We welcome community contributions. See our Contribution Guide for details.
UCP is an open-source project under the Apache License 2.0.