@opencommerceprotocol/adapter-generic
v1.0.0
Published
Open Commerce Protocol — Generic adapter for any platform via CLI
Downloads
67
Maintainers
Readme
@opencommerceprotocol/adapter-generic
Generic Open Commerce Protocol adapter for any e-commerce platform. Wraps the @opencommerceprotocol/cli tool as a standalone binary, providing a platform-agnostic way to generate and validate OCP files.
Installation
npm install -g @opencommerceprotocol/adapter-genericOr as a project dependency:
npm install @opencommerceprotocol/adapter-genericQuick Start
After installation, run the CLI:
ocp-genericThis launches the OCP CLI, which can generate OCP manifests (ocp.json), product feeds (products.jsonl), and store descriptions (ocp.md) for any e-commerce platform.
Usage
The generic adapter re-exports the full @opencommerceprotocol/cli interface. Use it when your platform does not have a dedicated adapter (like Shopify or WooCommerce). It provides:
- Manifest generation -- create a
.well-known/ocp.jsonfile for your store - Product feed generation -- export your catalog as JSONL
- Validation -- validate manifests and feeds against the OCP spec
This adapter serves as the base for building custom platform adapters. To create a new adapter, use @opencommerceprotocol/adapter-generic as a starting point and add platform-specific handler logic.
Dependencies
@opencommerceprotocol/cli-- CLI tool for generating and validating OCP files@opencommerceprotocol/spec-- OCP types and schemas@opencommerceprotocol/validator-- Runtime validation
License
Apache-2.0
