Headless for commerce

This is for:

Developer

What’s Coveo Headless for commerce?

Coveo Headless is a library for developing Coveo-powered UI components. It works as a middle layer for applications, opening a line of communication between the UI elements and Coveo.

In the context of Coveo for Commerce, Headless is used in conjunction with the Coveo Merchandising Hub (CMH) to power your product discovery interfaces. For commerce, Headless exposes the Commerce Engine, which uses the Commerce API to query products from Coveo, and the Event Protocol to send analytics events to Coveo.

Notes

When should I use Headless?

The Headless library wraps the complexity of the Coveo APIs without sacrificing flexibility. It’s usable with any web development framework and it manages the state of your page for you. Rather than prebuilt UI components in Atomic, it provides an extendable set of reducers and controllers that allow you to connect your own product discovery UI components to the Coveo APIs.

If you want to use Coveo to power your own UI component library, then you should definitely consider using Headless.

Atomic for commerce and Headless for commerce aren’t mutually exclusive. Atomic components are built on Headless, so both libraries read and write the state of the same commerce engine. A single implementation can use Atomic components for most of a storefront and Headless controllers for the pieces Atomic doesn’t cover, such as a cart or a product detail page. The commerce-hybrid sample demonstrates this approach with a Headless search box, cart, and product page in an Atomic storefront.

If only part of your interface needs components of your own, consider starting with Atomic for commerce and building just that part with Headless.

Where to start?

To learn the basics of Headless, depending on your use case, see:

To learn how to build a product discovery interface with Headless, refer to the following articles:

You may also want to check out the Headless Commerce engine reference documentation.