@3dsource/metabox-modular-configurator-api
    Preparing search index...

    Class GetCallToActionInformation

    Represents a command to get a Call To Action Information from Metabox Modular Configurator. This class sends a message to the Metabox API to generate Call To Action information based on the current configuration and sends it to the endpoint URL from the CTA information.

    ecomConfiguratorDataUpdated is not its reply — that fires once, as the ecom data loads — so subscribe to it from the apiReady callback, not around this call. To follow the workflow itself, listen to 'ctaStatusChanged': it reports 'started', then 'ready' or 'failed'.

    ctaStatusChanged is additive and requires configurator-side support. There is no redirect url to receive: MetaBox posts the configuration to the callback URL from admin and navigates to the redirectUrl the endpoint returns, reporting an unusable reply in its own UI. On success the user is navigated away, so treat 'started' and 'failed' as the load-bearing states.

    Runs the CTA workflow. The CTA label and callback URL reach the host on the load-time ecomConfiguratorDataUpdated event, not from this command.

    Triggers the CTA (Call-to-Action) workflow configured in MetaBox admin. The CTA label and callback URL are set in admin. When invoked, MetaBox POSTs the full configuration JSON (including BOM) to your callback URL endpoint, which returns a { redirectUrl }.

    Call only after user completes configuration. Subscribe to ecomConfiguratorDataUpdated to get CTA label/URL for building custom CTA buttons in your UI. The POST payload includes the full bill of materials — your backend endpoint processes it and returns a redirect URL.

    import { Communicator, EcomConfigurator, GetCallToActionInformation } from '@3dsource/metabox-modular-configurator-api';
    window.env3DSource.apiReady = (api: Communicator) => {

    //Subscribe as soon as the api is ready: this event fires once, when the ecom data loads
    api.addEventListener('ecomConfiguratorDataUpdated', (data:EcomConfigurator) => {
    console.log('Ecom configurator params:', data);
    });

    // Send the command to get Call To Action information from Metabox Modular Configurator
    api.sendCommandToMetabox(new GetCallToActionInformation());
    };
    Index
    data: ToMetaBoxMessageEnvelope

    The message envelope populated by subclass constructors and sent via Communicator.sendCommandToMetabox.