Represents a command to set a product by its ID.
This action sends a message to the Metabox API to set a product using the provided product ID.
To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Sets the active product in the Basic Configurator by its UUID. Triggers a full state update including
available materials, slots, showcase data, and environment compatibility.
Practical Application
Selects which product to display in the 3D viewport. Takes a productId (UUID). Use to build product picker UIs,
deep-link to specific products, or switch products programmatically based on external catalog selections.
The configurator responds with a full ConfiguratorEnvelope via configuratorDataUpdated.
AI Coding Best Practices
Call api.sendCommandToMetabox(new SetProduct('product-uuid')). Get valid product IDs from
configurator.products in the configuratorDataUpdated envelope. Subscribe to configuratorDataUpdated
BEFORE sending the command. After switching products, material and environment selections may reset —
re-apply them if needed.
//Subscribe to the event before sending the command to ensure you capture the response api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => { console.log('State updated after applied new product:', data); });
Represents a command to set a product by its ID. This action sends a message to the Metabox API to set a product using the provided product ID. To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Sets the active product in the Basic Configurator by its UUID. Triggers a full state update including available materials, slots, showcase data, and environment compatibility.
Practical Application
Selects which product to display in the 3D viewport. Takes a productId (UUID). Use to build product picker UIs, deep-link to specific products, or switch products programmatically based on external catalog selections. The configurator responds with a full ConfiguratorEnvelope via configuratorDataUpdated.
AI Coding Best Practices
Call
api.sendCommandToMetabox(new SetProduct('product-uuid')). Get valid product IDs fromconfigurator.productsin the configuratorDataUpdated envelope. Subscribe to configuratorDataUpdated BEFORE sending the command. After switching products, material and environment selections may reset — re-apply them if needed.Example
Param: productId
The product ID.