clerk-orgs

Implements Clerk Organizations for multi-tenant B2B SaaS with roles, invitations, and enterprise SSO.

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Ramadan-Elgamal/Autobees --skill clerk-orgs-ramadan-elgamal
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-orgs
Source: https://github.com/Ramadan-Elgamal/Autobees/tree/main/.agents/skills/clerk-orgs
Command: npx skills add https://github.com/Ramadan-Elgamal/Autobees --skill clerk-orgs-ramadan-elgamal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @clerk/nextjs, and includes references (resource) components.

What problem does it solve? Building multi-tenant B2B SaaS requires organization switching, role-based access control, member invitations, and enterprise SSO — all of which are error-prone to wire up correctly with Clerk. This Skill provides the canonical patterns, permission slugs, and configuration steps so org features work the first time. ## Core Features & Use Cases - Org-aware routing and authorization: Read orgId/orgSlug from auth(), validate URL slugs against the active org, and gate pages with has({ role }) or has({ permission }) using canonical System Permission slugs. - Member and invitation management: Send, list, and revoke organization invitations via the Backend API with required inviterUserId, or use the built-in <OrganizationProfile /> UI. - Enterprise SSO and verified domains: Configure per-org SAML/OIDC connections, access provider metadata via enterpriseAccounts[i].enterpriseConnection, and understand JIT provisioning. - Use Case: Add an <OrganizationSwitcher /> to a Next.js dashboard, scope all data queries by orgId from the session, and restrict an admin settings page to users with the org:admin role. ## Quick Start Ask the AI to add Clerk organization support with an org switcher and org-scoped dashboard data to your Next.js app.

Frequently Asked Questions about clerk-orgs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add organization support to a Clerk Next.js app?▼

Enable Organizations in the Clerk Dashboard, then render <OrganizationSwitcher /> and read orgId from auth() to scope data. Gate routes with has({ role: 'org:admin' }) or permission checks, and verify the URL slug matches the active orgSlug on every org-scoped page.

How do I check org roles and permissions with Clerk?▼

Destructure has from await auth() and call has({ role: 'org:admin' }) or has({ permission: 'org:sys_memberships:manage' }). Use only canonical System Permission slugs like org:sys_memberships:manage — invented slugs such as org:manage_members always return false.

Why does OrganizationSwitcher not show the Personal Account option?▼

Membership required is the default mode since August 22, 2025, and it disables personal accounts. Switch to Membership optional in Dashboard → Organizations settings if your app needs B2C and B2B coexistence.

How do I configure enterprise SSO for a Clerk organization?▼

Add a SAML or OIDC connection in Dashboard → Configure → Enterprise Connections, scoped to the organization with its domain. Users auto-join via JIT provisioning, and provider metadata is read from user.enterpriseAccounts[i].enterpriseConnection?.provider.

Why does has({ permission }) return false even for org admins?▼

When Clerk Billing is enabled, permissions are gated at the feature level — the Feature associated with that permission must be included in the organization's active Plan. Check Dashboard → Billing → Plans → Features and attach the required Feature.

How do I send organization invitations with the Clerk Backend API?▼

Call clerk.organizations.createOrganizationInvitation with organizationId, inviterUserId, emailAddress, role, and redirectUrl after verifying the caller has org:sys_memberships:manage. The inviterUserId parameter is required for human-initiated invitations.