These docs are for v0.1.0. Click to read the latest docs for v1.0.0.

Every time the current conversation changes (for example, when you click a new conversation in the list), an event is sent to our library. We can listen to these events and operate on them like this.

Front.on('conversation', function (data) {
    // triggered when a conversation is loaded
});

Front.on('no_conversation', function () {
    // triggered when no conversation is selected
});

Front.on('panel_visible', function (visible) {
    // triggered when your plugin becomes visible or invisible
    // you can also test Front.visible
});

The data object set to the callbacks of the event contains four fields:

  • contact The conversation's contact
  • conversation The conversation object
  • message The most recent message object
  • otherMessages an array of the following messages