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

Get read status of a message

Copy link

In a group channel, the read status of messages is crucial for understanding which messages have been read by which members. This document explains how to get read status of a message in a group channel.

To get the read status of messages in a group channel, use the getReadStatus() method. The method returns a dictionary object with the user ID as the key and the read status as the value. The read status object contains the timestamp of the last read message.

JavaScriptTypeScript
// If includeAllMembers is set to false, the results won't include the current user.
const result = channel.getReadStatus(includeAllMembers = false);

if (result) {
    Object.keys(result).forEach(userId => {
        const readStatus = result[userId];
        const readTime = readStatus.ts;
        ...
    })
}