Expivi SDK
This guide explains how to use Expivi SDK as a package in your own application. It starts with the overall lifecycle of a configurator session and then documents the public use* hooks exposed by @expivi/product-configurator.
At a high level, an Expivi integration is built around three layers:
ProductConfiguratorholds product state, loads product data, runs rules, and serializes configuration.- Your application mounts its UI and provides access to the configurator instance.
use*hooks expose read and write controllers for products, attributes, layout entities, messages, pricing, media, quote requests, and Web2Print flows.
Minimal flow
import { ProductConfigurator } from "@expivi/product-configurator";
const configurator = new ProductConfigurator({
apiBaseUrl: "...",
apiToken: "...",
});
await configurator.loadProduct(productId);
After loading, you can create controllers such as:
const global = useProductConfigurator(configurator);
const products = useStoreProductOffers(configurator);
const messages = useMessages(configurator);
Typical host application flow
Most applications follow this sequence:
- Initialize
ProductConfiguratorwith API credentials and optional locale settings. - Call
loadProduct(productId). - Wait until the configurator is in a usable lifecycle state.
- Create hook controllers for the parts of the SDK your UI needs.
- Render product UI, messages, media pickers, quote forms, or Web2Print tooling on top of those controllers.
Initialization model
Most hook controllers require the configurator to already be initialized. In practice, create useProductConfigurator(configurator) first, watch its status, and create the rest of your controllers once the configurator reaches LOADED or READY.
Guide structure
getting-started/bootstrappingexplains package setup and the configurator lifecycle.getting-started/app-shellexplains how to structure your host UI around controller state.hooks/*documents every public hook exported asuse*from@expivi/product-configurator.