/ SDKs / JavaScript
SDKs
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
JavaScript
Version 4

Send typing indicators to other members

Copy link

If the startTyping() and endTyping() methods are called while the current user is typing a text message in a group channel, the onTypingStatusUpdated() method in the channel event handler is invoked on all channel members' devices except the one that belongs to the current user.

JavaScriptTypeScript
groupChannel.startTyping();
groupChannel.endTyping();
// ...

const channelHandler = new GroupChannelHandler({
    onTypingStatusUpdated: (channel) => {
        const members = channel.getTypingUsers();
        // Refresh the typing status of members within the channel.
    },
});

sb.groupChannel.addChannelHandler(UNIQUE_HANDLER_ID, channelHandler);