Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Message
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

Send typing indicators to other members

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);