Represents a command to reset the configurator state to its defaults.
This class sends a message to the Metabox API to restore product, materials,
and environment selections to the values defined by the configurator template.
To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Resets the entire configurator state to defaults — product, product materials, environment, and
environment materials all return to the template-defined initial values. Used to give users a clean
'Start Over' affordance without reloading the iframe.
Practical Application
Powers 'Reset to Defaults' / 'Start Over' buttons in product configurators. Unlike ResetCamera (which
only touches viewport state), ResetConfiguration wipes all user-applied selections back to template
defaults. The configurator responds with a full ConfiguratorEnvelope via configuratorDataUpdated, so
UI state derived from the envelope (selected swatches, current product, environment chips) will
re-sync automatically.
AI Coding Best Practices
Call api.sendCommandToMetabox(new ResetConfiguration()). No parameters. Subscribe to
configuratorDataUpdated BEFORE sending so you capture the reset envelope. If your UI maintains local
selection state separate from the envelope, clear it in the same handler. Pair with ResetCamera if
you also want the viewport returned to its default framing.
//Subscribe to the event before sending the command to ensure you capture the response api.addEventListener('configuratorDataUpdated', (data: ConfiguratorEnvelope) => { console.log('Configurator reset to default state:', data); });
Represents a command to reset the configurator state to its defaults. This class sends a message to the Metabox API to restore product, materials, and environment selections to the values defined by the configurator template. To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Resets the entire configurator state to defaults — product, product materials, environment, and environment materials all return to the template-defined initial values. Used to give users a clean 'Start Over' affordance without reloading the iframe.
Practical Application
Powers 'Reset to Defaults' / 'Start Over' buttons in product configurators. Unlike ResetCamera (which only touches viewport state), ResetConfiguration wipes all user-applied selections back to template defaults. The configurator responds with a full ConfiguratorEnvelope via configuratorDataUpdated, so UI state derived from the envelope (selected swatches, current product, environment chips) will re-sync automatically.
AI Coding Best Practices
Call
api.sendCommandToMetabox(new ResetConfiguration()). No parameters. Subscribe to configuratorDataUpdated BEFORE sending so you capture the reset envelope. If your UI maintains local selection state separate from the envelope, clear it in the same handler. Pair with ResetCamera if you also want the viewport returned to its default framing.Example