initializeAssistant
provided by the CompanionWidget
library, loaded alongside the integration script.
Before running the initialization method, the iframe should be added to the DOM, loaded properly, and ready for receiving the data. The iframe fires the event “companion-iframe-loaded
” when properly loaded.
Initial data should be an empty object or contain variables as keys to match the prompt variables.
Example of how to initialize the Companion widget with data on the iframe loads:
CompanionWidget.initializeAssistant
could be called at any time later to provide fresh data to the companion.
bubble
(default) and iframe
.
bubble
mode script will create a widget button that expands into the modal window with a companion iframe.
In the iframe
mode it will embed an <iframe>
into the DOM element with an ID specified in the Container ID
property:
data-unique-id
so we can identify different end users, save some data and use it in future interaction. Value of this param can be any unique string less than 30 characters.
"x-ck": <Secret Key>
), allowing you to verify that the incoming requests are genuinely from our API.{variable_name}
.
Example:
https://api.outrival.com/webhooks/twilio/intercept-sms