Membership object
Membership represents a single user-channel relationship in a chat.
Properties
Membership has the following properties:
1class Membership {
2 channel: Channel,
3 user: User,
4 custom: ObjectCustom
5}
| Parameter | Description |
|---|---|
channelType: Channel | Channel object. |
userType: User | User object. |
customType: ObjectCustom | Any custom properties or metadata associated with the channel-user membership, such as lastReadMessageTimetoken. |
API limits
To learn about the maximum length of parameters used to set channel membership metadata, refer to REST API docs.
Methods
Available methods:
getUnreadMessagesCount()- (getter)
lastReadMessageTimetoken setLastReadMessage()setLastReadMessageTimetoken()streamUpdates()- (static)
streamUpdatesOn() update()
Use case
Membership methods enable:
- Updating user-channel relationships and getting updates on changes
- Tracking the last message read by a user on a channel
- Getting the count of unread messages for a user