Overview
Fetches the member list for a conversation on mount and provides actions to add members, remove members, change roles, and leave the conversation. Also exposesupsertMember and removeMemberLocally for real-time socket-driven updates.
Requires
ChatProvider in the component tree.Usage Example
Props
The ID of the conversation whose members to fetch.
Returns
The current member list. See ConversationMember.
true while the initial fetch is in progress.Adds a user to the conversation. Updates the local member list on success.
Removes a user from the conversation. Updates the local member list on success.
Removes the current user from the conversation.
Updates a member’s role. Updates the local member list on success.
Inserts or replaces a member in the local list by
userId. Intended for use with real-time socket event handlers.Removes a member from the local list by
userId without making an API call. Intended for use with real-time socket event handlers.Notes
- The member list is fetched with a limit of 100. For very large conversations, consider lazy-loading or paginating members separately.
- For integration guidance, see Chat: Conversations.

