Clerk Auth

Integrates Clerk authentication in React/Vite, Next.js App Router, and Cloudflare Workers apps. Covers ClerkProvider setup, clerkMiddleware and createRouteMatcher for protected routes, token verification with @clerk/backend verifyToken, custom JWT templates and session claims (user.public_metadata, org_id, org_role) for RBAC, Hono integration via @hono/clerk-auth, shadcn/ui auth components, and Playwright E2E testing with @clerk/testing, +clerk_test emails and the 424242 OTP. Documents 11 pitfalls: Missing Clerk Secret Key, JWKS cache races, missing authorizedParties CSRF risk, Core 2 import path changes, JWT size limits, ClerkProvider cannot be used as a JSX component, async auth() confusion, and Vite dev 431 header errors. Use when adding Clerk to a project, protecting routes, verifying tokens, shaping JWT claims, testing auth flows, or debugging Clerk authentication errors.

jackspace Updated

File contents

jackspace/ClaudeSkillz/tree/main/skills/clerk-auth commit 8c553300ff

Frequently asked questions

npx skillmds@latest add jackspace/clerk-auth