Shareable tenant links
Public-facing organization content
Clerk · Pipe
Clerk organization slugs are readable identifiers, such as acme-corp, that can appear in URL paths. Clerk can use matching slug routes to activate the corresponding organization and support tenant-specific navigation.
An organization slug is a readable identifier placed in a URL path, such as /orgs/acme-corp. Clerk middleware can recognize the matching route pattern and make the organization represented by the slug active for the session; components can also be configured to navigate to slug-based URLs.
organizationPatterns: ['/orgs/:slug', '/orgs/:slug/(.*)']| Name | Type | Description |
|---|---|---|
organizationPatterns | string[] | URL route patterns that identify organization-specific paths and contain :slug or :id. |
import { clerkMiddleware } from '@clerk/nextjs/server'
export default clerkMiddleware({
organizationSyncOptions: {
organizationPatterns: ['/orgs/:slug/(.*)'],
},
})Configure Clerk middleware so a URL containing an organization slug can select that organization as active.
Public-facing organization content
Applications with frequent organization switching
Tenant-scoped application areas
An organization slug is a human-readable URL identifier, for example acme-corp. Putting it in the path makes organization-specific links shareable and gives the current tenant visible URL context.
Follow-up: When should slugs be avoided? Avoid them when most users belong to one organization or when organization-specific URLs do not add meaningful context.
Configure organization navigation properties such as afterCreateOrganizationUrl and afterSelectOrganizationUrl with a route like /orgs/:slug. This makes creation and selection navigate to the slug-based organization path.
Follow-up: Which components support this configuration? Clerk documents OrganizationSwitcher and OrganizationList as components with options for slug- and ID-based navigation.
Configure middleware organization patterns with a route parameter named :slug, such as /orgs/:slug or /orgs/:slug/(.*). When the request matches, Clerk uses the slug to set that organization as active.
Follow-up: What parameter matches an organization ID instead? Use :id; the documented pattern names are :id for an ID and :slug for a slug.
OrganizationSwitcherOrganizationListafterCreateOrganizationUrlafterSelectOrganizationUrlorganizationSyncOptionsclerkMiddleware