Organization switcher
In the organization experience, users may switch between organizations. Each time they switch, the app fetches a new organization token to load the relevant information.
How to implement it
- Create a dropdown or similar UI component to list all organizations available to the user.
- When the user selects a different organization, get its ID and call the SDK method
getOrganizationToken(organizationId)to fetch the corresponding organization token. (The SDK handles token caching for you.) - Store the selected organization ID (in the URL or client storage), and always use it to fetch the paired organization token for organization-specific resources.