clerk-orgs

Implement Clerk Organizations for B2B SaaS with org switching, RBAC, invitations, and enterprise SSO.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/divinaarmuela/Content --skill clerk-orgs-divinaarmuela
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-orgs
Source: https://github.com/divinaarmuela/Content/tree/main/.claude/skills/clerk-orgs
Command: npx skills add https://github.com/divinaarmuela/Content --skill clerk-orgs-divinaarmuela

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 management, role-based access control, member invitations, and enterprise SSO — all of which are error-prone to implement from scratch. This Skill provides the correct Clerk Organizations APIs, canonical permission slugs, and configuration steps so you avoid common pitfalls like invented permission names, stale session roles, and misconfigured membership modes. ## Core Features & Use Cases - Organization Management: Create orgs, switch between them with <OrganizationSwitcher />, and scope routes by orgSlug with slug-verification invariants. - Role-Based Access Control: Gate pages and server actions with has({ role }) and has({ permission }) using the canonical org:sys_* System Permissions catalog, plus custom roles and Role Sets. - Invitations & Memberships: Send, list, and revoke invitations via the Backend API with required inviterUserId, or use the built-in <OrganizationProfile /> UI. - Enterprise SSO & Verified Domains: Configure per-org SAML/OIDC connections, JIT provisioning, and correct enterpriseConnection.provider field access. - Use Case: Add an org-scoped dashboard to a Next.js app where admins invite teammates, members see only their org's data, and enterprise customers sign in via their company's SAML provider. ## Quick Start Ask the AI to add Clerk organization support to your app with an org switcher, org-scoped dashboard data, and admin-only settings pages.

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 />` from @clerk/nextjs and read `orgId` from `await auth()` to scope data. Gate routes with `has({ role })` or `has({ permission })` 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 has({ permission }) return false even though the user has the role?

When Clerk Billing is enabled, permissions are gated at the Feature level: `has({ permission })` returns false if the associated Feature is not included in the organization's active Plan. Attach the Feature to the Plan in Dashboard → Billing → Plans → Features.

Why doesn't OrganizationSwitcher 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 specific Clerk organization?

Add a SAML or OIDC connection in Dashboard → Configure → Enterprise Connections scoped to the organization, supplying the IdP metadata. Users auto-join via JIT provisioning, and custom sign-in flows use `strategy: 'enterprise_sso'` with provider data at `enterpriseAccounts[i].enterpriseConnection?.provider`.

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.