Skip to content

Instantly share code, notes, and snippets.

<script src="https://widget.flowxo.com/embed.js" data-fxo-widget="my-own-widget-code"></script>
<script>
// Wait until the messenger is fully
// ready, then send a message
FxoMessenger.on('stateChanged', function(state) {
if (state === 'connected') {
FxoMessenger.sendMessage('Hey!');
}
});
<script>
function messengerReady() {
// Wait until the messenger is fully
// ready, then send a message
FxoMessenger.on('stateChanged', function(state) {
if (state === 'connected') {
FxoMessenger.sendMessage('Hey!');
}
});
FxoMessenger.onMessageReceived(callback)
FxoMessenger.on<EventName>(callback)
FxoMessenger.removeListeners(<optional eventName>)
FxoMessenger.on(eventName, callback)
FxoMessenger.toggle();
FxoMessenger.destroy();
FxoMessenger.create();
// Set the messenger to open fullscreen
FxoMessenger.getState();
// Returns Object:
// {
// state: "connected",
// color: "#4B0082",
// fullscreen: true,
// headerText: "Chat to Us"
// }