InternalInternalConstructs a Communicator, replacing any existing instance, and begins listening for messages.
Optionalconfig: Partial<MetaboxCommandConfig>Storage for callback listeners by message type.
StaticinstanceSingleton reference to the current communicator instance.
Registers an event listener for messages dispatched by the Metabox.
The event name to listen for (e.g. 'configuratorDataUpdated').
Handler invoked with the typed payload when the event fires.
Cleans up resources and stops listening for messages.
Dispatches a typed event to all registered listeners.
The event name to dispatch.
The payload to pass to each listener.
Removes a previously registered event listener.
The event name the listener was registered for.
The same function reference that was passed to addEventListener.
Posts a command to the Metabox iframe.
An action command containing data to send.
StaticclearDestroys all active Communicator instances and clears the internal registry.
StaticcreateListens for Metabox to signal readiness, then initializes communicator.
Called with the new Communicator once the Metabox is loaded.
The environment in which the Communicator is running.
Optionalconfig: Partial<MetaboxCommandConfig>optional initial config: standalone - if true - disable metabox custom template and all logic
StaticgetRetrieves a registered Communicator instance by its key.
The composite key (version_environment_appId) identifying the instance.
Handles messaging between the host page and embedded Metabox content.
What does it unlock?
Internal class that creates a proxy/communication layer between the API and MetaBox. Handles reading and sending commands through the established connection.
Practical Application
The API handle returned in the integrateMetabox callback. Provides sendCommandToMetabox() to send commands, and addEventListener()/removeEventListener() for event subscriptions. This is your entire interface to the MetaBox Unreal Engine stream.
AI Coding Best Practices
Store the Communicator reference from the apiReadyCallback in a module-scoped variable or state store. NEVER send commands before this callback fires. All commands and event listeners go through this single api object. Clean up listeners with removeEventListener on component unmount.
Use Communicator.createInstance or the integrateMetabox helper to instantiate.