Skip to main content

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.

Usage Example

Parameters

string
required
UUID of the space to check membership for.

Returns

boolean
Whether the user has an active membership.
"admin" | "moderator" | "member" | null
The user’s role. null if not a member.
"pending" | "active" | "banned" | "rejected" | null
The user’s membership status. null if no membership record exists.
Date | null
When the membership was created. null if not a member.
object
Resolved permissions: canPost, canModerate, canRead, isAdmin, isModerator.