Skip to content

OrganizationProfile

<OrganizationProfile> is the prebuilt organization self-service card. For an organization admin it exposes three tabs:

  • General — rename the organization.
  • Members — list members, change a member’s role, remove a member, and leave the organization.
  • Invitations — create an invitation (as a shareable link), see the pending invitations, and revoke one.

A non-admin member sees a read-only view with a Leave action. Everything — the data, labels, and theme — is read from <ToriiProvider> context.

For the full feature — roles, permissions, and dashboard setup — see Organizations & roles.

import { OrganizationProfile } from '@torii-js/torii-react';
function OrgSettings() {
return (
<OrganizationProfile
onRenamed={(name) => console.log('renamed to', name)}
onLeft={() => console.log('left the org')}
buildInviteLink={(token) => `https://app.example.com/accept?token=${token}`}
/>
);
}

All optional: the card is fully wired by context and defaults to the active org.

Prop Type Description
organizationId string Org to show. Defaults to the active org.
onRenamed (name: string) => void Fired after a successful rename, with the new name.
onMemberRoleChanged (userId: string, role: string) => void Fired after a member’s role changes (new role key).
onMemberRemoved (userId: string) => void Fired after a member is removed.
onLeft () => void Fired after the caller leaves the org (self-removal).
buildInviteLink (token: string) => string Build the shareable accept link shown after creating an invitation. When omitted, the raw token is shown (still copyable).
onError (error: Error) => void Fired when a fetch or mutation fails.

Creating an invitation returns a one-time token; the tab renders it as a copyable link (via buildInviteLink) for you to share with the invitee. If the environment configures an invitation accept URL, Torii also emails the invitee a link to it best-effort — the share link is the fallback either way, so you can always deliver it yourself. The invitee accepts from within your app while signed in via useOrganizations().acceptInvitation(token) (their verified email must match the invite), or lands on your <AcceptInvitation> route.

Need a headless version? useOrganizationInvitations exposes the same list/create/revoke without the UI.

  • Admin-gated tabs. General and Invitations only render for the org’s admin (creator) role; a non-admin sees the read-only members view + Leave. This mirrors the server, which gates these operations to the admin role.
  • Rename refreshes. A successful rename refreshes the cached org list, so the new name propagates to <OrganizationSwitcher> and <OrganizationList> too.
  • Last-admin protection. The server rejects removing/demoting the last admin (surfaced via onError).
  • Runtime-gated: renders null until the SDK runtime is ready.

Honours the appearance prop on <ToriiProvider>. Relevant slots: card, formButtonPrimary. See elements.