Represents a command to set a material by its slot ID and Material ID.
To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Sets a material variant for a product slot. Simulates selecting a different material/finish from the menu
for a specific customizable surface on the product.
Practical Application
Applies a material to a specific slot on the active product. Takes slotId (string) and materialId (UUID).
Use to build swatch pickers, apply preset themes/bundles, or sync material selections from an external
PIM/ERP system via externalId mapping.
AI Coding Best Practices
Get valid slotId and materialId values from the product's slot definitions in the configuratorDataUpdated envelope —
check product.slots and each slot's enabledMaterials list. Pattern:
new SetProductMaterial('slot-name', 'material-uuid'). The referenced product must already be set.
//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 material:', data); });
Represents a command to set a material by its slot ID and Material ID. To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Sets a material variant for a product slot. Simulates selecting a different material/finish from the menu for a specific customizable surface on the product.
Practical Application
Applies a material to a specific slot on the active product. Takes slotId (string) and materialId (UUID). Use to build swatch pickers, apply preset themes/bundles, or sync material selections from an external PIM/ERP system via externalId mapping.
AI Coding Best Practices
Get valid slotId and materialId values from the product's slot definitions in the configuratorDataUpdated envelope — check
product.slotsand each slot'senabledMaterialslist. Pattern:new SetProductMaterial('slot-name', 'material-uuid'). The referenced product must already be set.Example
Param: slotId
The slot ID.
Param: materialId
The material ID.