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.removeMember and changeRole act on other members and refuse your own user id (400 chat/own-member-id). Your own membership is …/members/me: leave removes it, and useCheckMyConversationMembership reads it.
Usage Example
Props
Returns
The current member list. When
spaceReputation is requested, each embedded user carries an added spaceReputation number. See ConversationMember and Reputation.Adds a user to the conversation and resolves to their member row, which has no
user. Updates the local member list on success; a member already listed keeps the user the list loaded.Removes another user from the conversation. Updates the local member list on success.
Removes the current user from the conversation (
DELETE /chat/conversations/:conversationId/members/me).Updates another member’s role and resolves to their member row, which has no
user. Updates the local member list on success, keeping the member’s loaded user.Inserts a member into the local list, or merges it into the listed member with the same
userId (keeping fields the incoming row lacks, such as user). Intended for use with real-time socket event handlers: a member:joined row carries no user.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.

