Skip to content

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.

ModelSource
sonnetpack: 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.

ItemValue
Install (Next.js)npm install @clerk/nextjs
Install (React)npm install @clerk/react
Install (Astro)npm install @clerk/astro
Docshttps://clerk.com/docs
Free tier50,000 MAU, 100 orgs, no credit card
Key env varsNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY
MiddlewareclerkMiddleware() — replaced authMiddleware
All routes defaultPublic — opt-in to protection via auth.protect()
I want to…File
Set up Clerk in Next.js, React, Remix, or Astroreference/setup.md
Configure middleware, protect routes, and check roles/permissionsreference/middleware.md
Use pre-built UI components — SignIn, UserButton, Protectreference/components.md
Read auth server-side via auth(), currentUser(), or auth.protect()reference/server-auth.md
Read auth client-side via useAuth, useUser, useOrganization hooksreference/client-auth.md
Create orgs, invite members, and manage roles and permissionsreference/organizations.md
Set up webhooks and handle user/org eventsreference/webhooks.md
Understand pricing tiers, MAU limits, and feature breakdownreference/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.