Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Clerk · Hook

useOrganizationList

React hook for accessing a user's organization memberships, invitations, and suggestions. It also supports creating organizations and changing the active organization.

How it works

Call this React hook with configuration for the organization data you need. Memberships, invitations, and suggestions are not fetched unless their option is set to true or configured; the returned object also exposes loading state, pagination, organization creation, and active-organization management.

Syntax

useOrganizationList(options?)

Parameters

NameTypeDescription
userMembershipstrue | { initialPage?: number; pageSize?: number; infinite?: boolean; keepPreviousData?: boolean }Enables and configures the paginated current-user organization memberships resource; supports true, initialPage, pageSize, infinite, and keepPreviousData.
userInvitationstrue | { initialPage?: number; pageSize?: number; status?: "expired" | "pending" | "revoked" | "accepted"; infinite?: boolean; keepPreviousData?: boolean }Enables and configures the paginated current-user organization invitations resource; supports invitation status values expired, pending, revoked, or accepted.
userSuggestionstrue | { initialPage?: number; pageSize?: number; infinite?: boolean; keepPreviousData?: boolean }Enables and configures the paginated current-user organization suggestions resource.

Returns

An object containing isLoaded, configured paginated organization resources such as userMemberships, userInvitations, and userSuggestions, plus methods including createOrganization() and setActive().

Key points

  • Use the hook to read the user's organization-related collections.
  • The hook combines organization-list data with creation and active-organization controls.
  • Configuration is supplied as one options object.
  • Enable each collection with true or a detailed configuration object.
  • The infinite option supports interfaces that continuously append more results.

Common mistakes

  • The three organization collections are empty until explicitly enabled.
  • Use infinite: true when loading additional pages should extend the existing collection.
  • If page size is omitted, each page contains at most 10 results.

Example: Paginated organization switcher

import { useOrganizationList } from '@clerk/react';

export function OrganizationSwitcher() {
  const { isLoaded, setActive, userMemberships } = useOrganizationList({
    userMemberships: {
      pageSize: 5,
      keepPreviousData: true,
    },
  });

  if (!isLoaded) return <p>Loading…</p>;

  return (
    <ul>
      {userMemberships.data?.map((membership) => (
        <li key={membership.id}>
          <button onClick={() => setActive({ organization: membership.organization.id })}>
            {membership.organization.name}
          </button>
        </li>
      ))}
    </ul>
  );
}

Loads the current user's organization memberships five at a time and lets each button make its organization active.

When to use it

Organization switcher

Display a user's organizations and let them switch the active organization.

Invitation management

Show pending or filtered organization invitations and let users accept them.

Organization creation

Create a new organization from a custom onboarding flow.

Incremental organization browsing

Load organizations incrementally in a paginated or infinite list.

Interview questions

QWhat does useOrganizationList() provide?

It exposes the current user's organization memberships, invitations, and suggestions, along with operations for creating organizations and managing the active organization. These collections require explicit configuration to be populated.

Follow-up: How would you implement an organization switcher? Configure userMemberships, render its data, and call setActive() with the selected organization.

QHow do you configure membership pagination?

Pass userMemberships: { pageSize: 5, keepPreviousData: true } to request a paginated membership list. The returned paginated resource provides the data and pagination methods for loading more results.

Follow-up: How can the list support infinite scrolling? Set infinite: true, which appends newly fetched results instead of replacing the current list.

QWhich organization-management actions are available?

The hook returns isLoaded, organization-list resources, createOrganization(), and setActive(). setActive() changes the active organization, while createOrganization() creates one with a supplied name.

Follow-up: How would invitations be handled? Enable userInvitations; each returned invitation can expose an accept() method for accepting it.

  • useAuth
  • setActive
  • createOrganization
  • OrganizationMembership
  • UserOrganizationInvitation
  • <OrganizationSwitcher />

Source: useOrganizationList() - Hooks - React | Clerk Docs. Checked 2026-10-15.