Skip to main content

Overview

useFetchSpaceTeam returns a callable function that fetches all admins and moderators of a space in a single non-paginated response. This is useful for displaying the space’s leadership team.

Usage Example

import { useFetchSpaceTeam } from "@replyke/react-js";

function SpaceTeam({ spaceId }: { spaceId: string }) {
  const fetchTeam = useFetchSpaceTeam();

  const loadTeam = async () => {
    const { data } = await fetchTeam({ spaceId });
    data.forEach(({ user, role }) => {
      console.log(user.displayName, role);
    });
  };
}

Parameters

spaceId
string
required
UUID of the space.

Returns

data
SpaceMemberWithUser[]
All admins and moderators with active status, including embedded user details. See SpaceMember.