Skip to main content

Overview

useCheckMyConversationMembership returns a callable that reads the signed-in user’s own membership in a conversation (GET /chat/conversations/:conversationId/members/me), without loading the member list. Who may ask is exactly who may read the conversation: anyone else gets the same 404 chat/not-found or 403 chat/not-a-member that reading it gives them. Your own membership is …/members/me: this hook reads it, and leave from useConversationMembers leaves it. removeMember and changeRole act on other members and refuse your own id.

Usage Example

Parameters

string
required
The ID of the conversation.

Returns

Promise<CheckMyConversationMembershipResponse> — a flat record. isMember is always present; a field that describes a membership you don’t have is left out, not sent as null. The three shapes:
  • Active member: { isMember: true, role, lastReadAt, mutedForever, mutedUntil }
  • Left or removed: { isMember: false, leftAt }
  • No membership yet (a space conversation you haven’t opened): { isMember: false }