> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Check my membership

> Check the current user's membership status in a space

## Overview

`useCheckMyMembership` returns a callable function that checks the authenticated user's membership in a specific space without loading the full space object.

## Usage Example

```tsx theme={null}
import { useCheckMyMembership } from "@sublay/react-js";

function MembershipBadge({ spaceId }: { spaceId: string }) {
  const checkMembership = useCheckMyMembership();

  const handleCheck = async () => {
    const result = await checkMembership({ spaceId });
    console.log(result.isMember, result.role, result.status);
  };
}
```

## Parameters

**spaceId** `string` *required*

UUID of the space to check membership for.

## Returns

**isMember** `boolean`

Whether the user has an active membership.

**role** `"admin" | "moderator" | "member" | null`

The user's role. `null` if not a member.

**status** `"pending" | "active" | "banned" | "rejected" | null`

The user's membership status. `null` if no membership record exists.

**joinedAt** `Date | null`

When the membership was created. `null` if not a member.

**permissions** `object`

Resolved permissions: `canPost`, `canModerate`, `canRead`, `isAdmin`, `isModerator`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.