Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Version 4
Home
/
Chat
/
JavaScript
/
Message

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.

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

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

sb.groupChannel.addChannelHandler(UNIQUE_HANDLER_ID, channelHandler);