Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.dev

useOrganizationList

Access methods for switching between active organizations and for listing available organizations and memberships.

Overview

The useOrganizationList hook gives you access to the list of available Organizations and OrganizationMemberships the user belongs to.

Additionally by using the setActive method you can set an organization as the active one and access its capabilities through the useOrganization hook.

The organizationList attribute is an array of objects consisted of the Organization and OrganizationMembership of each entry:

Usage

Make sure you've followed the installation guide for Clerk React before running the snippets below.

In the following example, useOrganizationList is used to map over the list of organizations and memberships to show some basic information for the entities.

Additionally by clicking the link on each list entry, you can set the target organization as the active one.


Note that your component must be a descendant of <ClerkProvider/>.

Showing organization list information

Was this helpful?

Clerk © 2022