An Eventful Release

Custom Message Actions


We added the ability to add custom actions to the message menu. This lets you build features like reporting, favouriting or quoting messages. When a user selects a custom message action, an event is triggered in the JavaScript SDK. Check out our documentation on message actions for more info.

New event handlers in the JS SDK

The TalkJS JavaScript SDK emits events in many situations, so you can react to things that happen within our systems or in the chat UI. For instance, we fire an event when a conversation is selected in the inbox. The code to listen for such an event used to look like this: 

inbox.on("conversationSelected", function(event) {
  console.log(event);
});

This style of event handlers is now deprecated. Instead, you can now this:

inbox.onConversationSelected(function(event) {
  console.log(event);
});

These new event methods return a Subscription object that you can use to unsubscribe from events. This replaces the "off()" methods, which are now deprecated too. We never want to break existing code, so even though they're deprecated, the old methods will always continue to work.


For a full list of deprecated methods and their alternatives, see the deprecated methods sections on Session and its associated Unreads object, Chatbox, Popup and Inbox.