Overview
useCheckMyMembership returns a callable function that checks the authenticated user’s membership in a specific space without loading the full space object. A user with a membership gets it back whatever its status (a banned user learns they’re banned); a user with no membership in a space they can’t see gets 404 space/not-found. It calls GET /spaces/:spaceId/members/me.
Your own membership is always …/members/me: this hook reads it and useLeaveSpace leaves it. The member hooks that take a userId (useUpdateMemberRole, useApproveMember, useDeclineMember, useBanMember, useUnbanMember) act on other members and refuse your own id.
Usage Example
Parameters
Returns
The user’s membership status. Present only when a membership record exists, whatever its status.
ISO timestamp of when the membership was created. Present only when
isMember is true.Resolved permissions:
canPost, canModerate, canRead, isAdmin, isModerator, from the same calculation as a fetched space’s memberPermissions (see How permissions are calculated). Present for a user with no membership too.
