Build a custom flow for viewing a user's organization memberships
This guide will demonstrate how to use the Clerk API to build a custom flow for viewing the list of a user's organization memberships.
The following example:
- Uses the
useOrganizationList()
hook to getmemberships
, which is a list of the current user's organization memberships.memberships
returnsdata
, which is an array ofOrganizationMembership
objects. - Maps over the
data
array to display the user's organization memberships in a table.
This example is written for Next.js App Router but can be adapted for any React meta framework, such as Remix.
The following example:
- Calls the
getOrganizationMemberships()
method to retrieve the list of organizations the current user is a part of. This method returnsdata
, which is an array ofOrganizationMembership
objects. - Maps over the
data
array to display the user's organization memberships in a table.
Use the tabs to view the code necessary for the index.html
and main.js
files.
Feedback
Last updated on