Hooks Overview
The package exports these public use* helpers:
Lifecycle & state
useProductConfigurator— configurator lifecycle and statususeMessages— validation and notification messages
Products
useProductOffer— a single product offeruseStoreProductOffers— all loaded product offersuseProductSelection— pick between selectable productsuseAdjacentProducts— products connected to the current one
Layout
useLayoutEntity— a single layout entity (routed by type)useStoreLayouts— all layout entitiesuseProductOfferLayout— the resolved layout tree for an offer
Attributes
useAttribute— a single attribute (routed by type)useStoreAttributes— all attributes
Pricing & output
usePriceBreakdown— line-by-line price breakdownuseBomBreakdown— bill-of-materials breakdownuseVisualization2d— 2D product visualizationuseMediaService— media library accessusePaletteService— color palette accessuseDownloadDesign— render/download the current designuseRequestQuote— offer inquiry / quote forms
Initialization rule
Every hook controller that extends HookController requires the configurator status to already be LOADED or READY. If not, the constructor throws:
throw new Error("Product configurator is not initialized.");
In practice:
- Use
useProductConfigurator(configurator)first. - Wait for
READY. - Then create other controllers.
Controller style
Most hooks return class instances, not reactive Vue refs. They follow a consistent pattern:
- getters for current data
subscribe(...)methods for store updates- imperative methods for mutations
serialize()andparse()on stateful controllers where persistence matters
Dynamic hook routing
Two hooks return different controller subclasses based on runtime type:
useAttribute(configurator, cid)picks a controller from the attributerttiuseLayoutEntity(configurator, cid)picks a controller from the layout entityrtti
That is why the useAttribute section is split into a common controller page and individual pages for each concrete attribute-controller type.