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.
widget
view script will create a widget button that expands into the modal window with a companion iframe.
In the iframe
view 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.{
and the autocomplete dropdown will appear where you can create or select pre-existing variables. You can provide test values for the variables to be used in the testing mode.
Example:
https://api.outrival.com/webhooks/twilio/intercept-sms