Skip to main content

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 exposes upsertMember and removeMemberLocally for real-time socket-driven updates.
Requires ChatProvider in the component tree.

Usage Example

Props

string
required
The ID of the conversation whose members to fetch.
string
Resolves each member’s reputation into a spaceReputation number on the embedded user. Accepts a space <uuid>, "none" (project-general bucket), or "context" (server-derived from the request context). Empty string, "general", and null are rejected. See Reputation.
boolean
When true, spaceReputation is the subtree sum (the space plus all its descendants). Only honored when spaceReputationId is an explicit <uuid>.

Returns

ConversationMember[]
The current member list. When spaceReputationId is set, each embedded user carries an added spaceReputation number. See ConversationMember and Reputation.
boolean
true while the initial fetch is in progress.
({ userId: string }) => Promise<void>
Adds a user to the conversation. Updates the local member list on success.
({ userId: string }) => Promise<void>
Removes a user from the conversation. Updates the local member list on success.
() => Promise<void>
Removes the current user from the conversation.
({ userId: string; role: 'admin' | 'member' }) => Promise<void>
Updates a member’s role. Updates the local member list on success.
(member: ConversationMember) => void
Inserts or replaces a member in the local list by userId. Intended for use with real-time socket event handlers.
({ userId: string }) => void
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.