Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Clerk Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-clerk-knowledge-patch-nevaberry-plugins)
---
name: clerk-knowledge-patch
description: Clerk
version: "1.0.0"
license: MIT
metadata:
author: Nevaberry
---
# Clerk compatibility guidance
Load this skill when implementing or upgrading Clerk authentication, sessions,
organizations, billing, UI components, deployment, or backend SDK integrations.
Use the topic references for complete API details, conditions, and examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [Architecture and deployment](references/architecture-and-deployment.md) | Keys, instances, cookies, routing, redirects, rendering, workspace administration |
| [Authentication and sessions](references/authentication-and-sessions.md) | Sign-in methods, biometric enrollment, tasks, reverification, OAuth, restrictions, JWT claims |
| [Frontend resources](references/frontend-resources.md) | Custom-flow hooks, legacy flows, linked accounts, resource events, session activation, API keys |
| [Core 3 migration](references/core-3-migration.md) | Password and OTP flows, OAuth transfer, Expo native UI and builds, Chrome extension clients |
| [JavaScript Backend SDK](references/javascript-backend-sdk.md) | Request authentication, machine tokens, user listing, credential imports, metadata updates |
| [Billing](references/billing.md) | Availability, catalogs, entitlements, prices, discounts, trials, drawers, checkout, billing APIs |
| [Components](references/components.md) | Sign-in forms, One Tap, callbacks, sign-out, profiles, organization navigation, loading |
| [Customization](references/customization.md) | Themes, appearance migrations, localization, delivery templates, Elements, profile extensions |
| [Organizations and enterprise](references/organizations-and-enterprise.md) | Tenancy, roles, permissions, invitations, domains, SSO, directory sync, organization hooks |
| [Integrations and webhooks](references/integrations-and-webhooks.md) | Webhook verification, middleware, MCP, Frontend API proxies, satellite synchronization |
| [Go Backend SDK](references/go-backend-sdk.md) | Clients, JWT verification, key caches, sessions, users, machines, organizations, administration |
| [Python Backend SDK](references/python-backend-sdk.md) | Request and response migrations, errors, verification, clients, directories, billing, Protect, logs |
## Breaking changes and deprecations
### Backend SDK upgrades
Go SDK v2.7.0 deprecates metadata fields on user and organization update methods.
Go SDK v2.5.1 requires Go 1.24 or newer.
Python 6.0.0 changes the requests to `clerk.users.update()` and
`clerk.organizations.update()` in breaking ways; check existing arguments.
Python 7.0.0 also changes error contracts, email verification models, user
responses, and billing credit adjustment responses. Consult the method lists
in the Python reference when checking response and exception handling.
Starting with Clerk Python SDK 7.1.0, omit `specter_enabled` from
`clerk.instance_settings.update_instance_protect()` requests. The deprecated
`clerk.users.list_trusted_devices()` and `revoke_trusted_device()` give way to
`clerk.users.list_biometric_credentials()` and `revoke_biometric_credential()`.
Python 7.2.0 changes the `clerk.users.list()` request and error contracts and
makes a breaking response change. It also deprecates the `end_user_facing_only`
filter on `clerk.logs.list()` and changes `started_at` on `list_group_events()`.
### JavaScript authentication and client migrations
The request state from `authenticateRequest()` exposes `isAuthenticated` and
deprecates `isSignedIn`. `clerkClient.sessions.verifySession(sessionId, token)`
is deprecated; verify requests with `authenticateRequest()` or verify the
session JWT directly.
In Chrome extension service workers, replace
`@clerk/chrome-extension/background` with `@clerk/chrome-extension/client`
and pass `background: true`.
Pass `redirectUrl` and `sessionId` directly to `<SignOutButton />` starting in
`@clerk/react` 6.1.3 and `@clerk/vue` 2.0.7. The nested `signOutOptions`
still works but emits a deprecation warning. Move `afterSignOutUrl` and
`afterMultiSessionSingleSignOutUrl` from `<UserButton />` to `<ClerkProvider />`.
### Appearance and enterprise migrations
Use themes from `@clerk/ui/themes` through `appearance.theme` and configure
layout through `appearance.options`. Appearance variables include
`colorForeground` instead of `colorText` and `spacing` instead of `spacingUnit`;
the customization reference contains the complete variable mappings.
Migrate SAML integrations from `/v1/saml_connections` to
`/v1/enterprise_connections`, which manages both SAML and OIDC.
## Authentication and session quick reference
### Core 3 custom flows
`useSignIn()` and `useSignUp()` expose `SignInFuture` and `SignUpFuture`.
Include the attempt object in React dependency arrays because its identity can
change as the flow progresses. Call `finalize()` once the attempt is `complete`.
Legacy attempts instead activate with
`await clerk.setActive({ session: attempt.createdSessionId })`.
Password flows use `signIn.password({ emailAddress, password })` or
`signUp.password({ emailAddress, password })`. Sign-in OTP uses
`signIn.emailCode` or `signIn.phoneCode` with `sendCode()` and
`verifyCode({ code })`. The Core 3 reference covers sign-up verification,
second factors, Client Trust, and OAuth transfer.
For passkeys on `SignInFuture`, use
`await signIn.passkey({ flow: 'discoverable' })`, then finalize when complete.
Enrollment uses `user.createPasskey()` from an authenticated session. Enable
another method for initial sign-up and MFA; each account supports 10 passkeys.
### Pending sessions and task routes
Pending sessions are signed out by default. Route `sessionStatus === 'pending'`
to a task page, or use `await auth({ treatPendingAsSignedOut: false })` in a
Next.js task handler that needs the user's ID. Map tasks through `taskUrls` or
use `<RedirectToTasks />`; task components cover organization choice, password
reset, and MFA setup.
### Session activation, tokens, and claims
Use `decorateUrl()` in `setActive()` navigation so the session cookie can be
refreshed through the Frontend API when needed. Use full-page navigation for
the absolute refresh URL and client-side routing for a relative path.
`session.getToken({ organizationId, skipCache: true })` requests a fresh token
for the specified organization while preserving the active organization.
The normal frontend token lifetime is one minute. Backend
`getToken({ template })` makes a network request counted toward Backend API limits.
Custom session claims should stay below about 1.2 KB to leave room in the
browser's 4 KB session cookie. Read them from `Auth.sessionClaims` and type them
through `CustomJwtSessionClaims`. JWT templates reserve their automatic claims;
session-bound fields such as `sid`, `v`, `pla`, and `fea` belong in session-token
customization.
### Reverification
Reverification checks are in public beta. `Auth.has()` and
`session.checkAuthorization()` accept `reverification`. `strict_mfa` requires
both factors within 10 minutes; `strict`, `moderate`, and `lax` check the second
factor within 10 minutes, one hour, and one day respectively.
`useReverification(actionOrFetcher)` retries after successful verification.
Fetch the token inside the wrapped fetcher so retries receive the updated token.
Handle cancellation with `isReverificationCancelledError()`. When the user has
no second factor, `second_factor` and `multi_factor` fall back to `first_factor`.
## Authorization and organization quick reference
### User sessions and machine tokens
Discriminate backend `Auth` by `tokenType`: `session_token` is a user session;
`api_key`, `oauth_token`, and `m2m_token` use the machine-auth shape and `scopes`.
In Next.js, `await auth.protect({ token: 'api_key' })` requires an API key.
For non-document requests with missing or invalid auth, protection returns
HTTP 404 for required session tokens and HTTP 401 for required machine tokens.
JavaScript `clerkClient.m2m.createToken()` defaults to opaque tokens with no
expiry. Pass `tokenFormat: 'jwt'` for local verification and
`secondsUntilExpiration` to bound the lifetime.
JWT M2M tokens remain valid until expiry; use opaque tokens for immediate revocation.
### Tenant context and permissions
Each tab has its own active organization. For organization-scoped background
fetches, call `getToken()` in the requesting tab and send the bearer token.
With URL-driven activation, an unknown slug or missing membership leaves the
previous organization active; compare the route slug with `orgSlug` before
serving tenant data.
Session claims carry custom permissions only. Define custom permissions for
server-side `has()` checks. With billing enabled, an organization permission
check also requires the corresponding feature in the active organization's plan.
Disable member role changes while `organization.getRoles()` reports
`has_role_set_migration` as true.
## UI, billing, and integration quick reference
### Experimental UI boundaries
Billing drawers, data hooks, and custom checkout use experimental entry points.
`@clerk/elements` is a beta for Next.js App Router with Clerk Core 2.
The provider's `localization` prop is experimental; the hosted Account Portal
stays in English. OAuth Client ID Metadata Documents are a beta that requires
support enablement for the workspace.
### Billing checkout and entitlements
Use `has({ plan: 'gold' })` or `has({ feature: 'widgets' })` for server-side
entitlements, or the corresponding `when` object on `<Show>`.
Experimental `useCheckout()` returns `{ checkout, errors, fetchStatus }`.
Start from `needs_initialization`, check the returned error, confirm payment,
then finalize to refresh session state and server-component authorization
before navigation. The experimental checkout and subscription-details buttons
throw for `for="organization"` without an active organization.
### Webhooks and request verification
Keep the webhook POST route public to session middleware and verify it with
`verifyWebhook()` from the framework SDK's `/webhooks` entry point.
Configure the endpoint signing secret separately for each instance.
In Express, register the route before JSON parsing and use `express.raw()`.
In Go SDK v2.9.0, HTTP middleware caches JWKs by instance; a custom `Backend` must implement
`clerk.CacheScoper` to use that cache. For manual `jwt.Verify` caching, key by
instance and `kid` and refetch JWKS for an uncached `kid`.
Python remote-key authentication retries decoding once after a signature
failure evicts the cached key and refetches JWKS. Pinned `jwt_key` failures
return immediately, so update the pinned key when signing keys rotate.