Skip to content

Instantly share code, notes, and snippets.

@johnmjackson
Created July 5, 2017 12:19
Show Gist options
  • Save johnmjackson/a56af353f58bfcb1603d9dbc73bc704b to your computer and use it in GitHub Desktop.
Save johnmjackson/a56af353f58bfcb1603d9dbc73bc704b to your computer and use it in GitHub Desktop.
<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!');
}
});
// Subscribe to all messages received,
// logging them to the console
FxoMessenger.on('messageReceived', function(message) {
console.log(message);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment