clerk
Use when implementing authentication with Clerk — drop-in UI components, organization management, user management, or webhook integration. Also use when adding auth to a project quickly without building custom auth UI.
| Model | Source |
|---|---|
| sonnet | pack: auth |
Full Reference
┏━ 🔧 clerk ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when implementing authentication with Cler… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Clerk is a drop-in authentication platform with pre-built UI components, organization management, and webhook sync. It ships complete sign-in/sign-up flows out of the box with zero custom UI required, and handles OAuth, email/password, passkeys, and MFA. The free tier supports 50,000 MAU with no credit card required.
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Install (Next.js) | npm install @clerk/nextjs |
| Install (React) | npm install @clerk/react |
| Install (Astro) | npm install @clerk/astro |
| Docs | https://clerk.com/docs |
| Free tier | 50,000 MAU, 100 orgs, no credit card |
| Key env vars | NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY |
| Middleware | clerkMiddleware() — replaced authMiddleware |
| All routes default | Public — opt-in to protection via auth.protect() |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Set up Clerk in Next.js, React, Remix, or Astro | reference/setup.md |
| Configure middleware, protect routes, and check roles/permissions | reference/middleware.md |
| Use pre-built UI components — SignIn, UserButton, Protect | reference/components.md |
| Read auth server-side via auth(), currentUser(), or auth.protect() | reference/server-auth.md |
| Read auth client-side via useAuth, useUser, useOrganization hooks | reference/client-auth.md |
| Create orgs, invite members, and manage roles and permissions | reference/organizations.md |
| Set up webhooks and handle user/org events | reference/webhooks.md |
| Understand pricing tiers, MAU limits, and feature breakdown | reference/pricing.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.