Membership object
Membership represents a single user-channel relationship in a chat.
Properties
The Membership object has the following properties:
| Parameter | Description |
|---|---|
ChannelType: Channel | Channel object. |
UserType: User | User object. |
CustomType: FString | 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
You can call the following methods on the Membership object.
Click on each method for more details.
GetMembershipData()GetUnreadMessagesCount()LastReadMessageTimetoken()SetLastReadMessage()SetLastReadMessageTimetoken()StreamUpdates()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