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:
import { integrateMetabox } from '@3dsource/metabox-front-api';
integrateMetabox('configurator-id',
'embed3DSource',
(api) => {
// Communicator is ready to use
},
{
standalone: false,
introImage: 'https://example.com/intro.png',
loadingImage: 'https://example.com/loading.png',
showLoadingProgress: true,
showResumeStreamPopup: true,
showUserInactivityTimer: true,
userInactivityTimeout: 20,
},
);
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
is 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) => { set up listeners, then set product, then environment }, { standalone: true }). Ensure a container div exists in DOM with non-zero dimensions. HTTPS required. Inside callback: 1) addEventListener for configuratorDataUpdated, 2) SetProduct, 3) SetEnvironment.