Skip to main content

Commerce

High Velocity Commerce package exposes a vendor agnostic interface to the cart and catalog providers.

Integration Functions

The @hv/commerce package exposes functions that insantiate cart and catalog integrations.

Catalog

The Catalog function provides the vendor agnostic interface to The catalog provider. It is intended to be used in server components or route handlers

Example usage:

const { getCategoryByHandle } = Catalog({
locale: 'en-US',
});

const categoryResult = await getCategoryByHandle('clothing');

Catalog Functions

namedescription
getNavigationCatalogReturns a navigation tree from the commerce vendor for navigation
getCategoryByHandleFetches a category by handle/slug
getCategoryByIDFetch a category by ID
getProductByIDFetch a product by ID
getProductByHandleFetch a product by handle/slug
getProductBySKUFetch a product by sku