The Basic Configurator ID (not a full URL). It is appended to
https://{domain}/metabox-configurator/basic/{configuratorId} to form the iframe src.
The id of the container element where the iframe will be injected.
Called when the Communicator instance is created on the host side.
Optionalconfig: IntegrateMetaboxConfigOptional configuration used to build the iframe URL and initialize the communicator. Supported fields:
Integrates the Metabox Basic Configurator into the page by injecting an iframe and initializing a Communicator instance for host-to-iframe messaging.
What does it unlock?
Main initialization function for MetaBox integration. Initializes the configurator, receives an API handle, and sets up all configurations.
Practical Application
THE entry point function. Creates the configurator iframe, establishes postMessage communication, and returns the Communicator api handle via callback. Call ONCE per configurator. Params: configuratorId (UUID), containerId (DOM element ID, default 'embed3DSource'), apiReadyCallback, config (IntegrateMetaboxConfig).
AI Coding Best Practices
Pattern:
integrateMetabox('uuid', 'div-id', (api) => { setup listeners, then set product, then environment }, { standalone: true }). Ensure container div exists in DOM with non-zero dimensions. HTTPS required. Inside callback: 1) addEventListener for configuratorDataUpdated, 2) SetProduct, 3) SetEnvironment.