Skip to content
Back to skills

Clerk

ASecurity

Clerk — authentication and user management with sign-in/sign-up, middleware, organizations, webhooks.

  • 47 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 12, 2026
developmentnextjs

Works with

  • cli

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add skeletorflet/opencode-supreme-setup --skill clerk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clerk?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clerk
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/skeletorflet-clerk/badge)](https://www.skillsdirectory.com/skills/skeletorflet-clerk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clerk
description: Clerk — authentication and user management with sign-in/sign-up, middleware, organizations, webhooks.
---

## clerk

### Authentication
- `<SignIn />` / `<SignUp />` — prebuilt UI components with customization props.
- `useAuth()` — `userId`, `sessionId`, `orgId`, `orgRole`, `isSignedIn`, `getToken()`.
- `auth()` helper in Next.js App Router — server-side session from `clerkMiddleware`.
- `clerkClient.users.getUser(userId)` — server-side user lookup.

### Middleware (Next.js)
- `clerkMiddleware((auth, req) => { ... })` — protect routes; returns `auth()` object.
- `createRouteMatcher(['/dashboard(.*)'])` — pattern-based route protection.
- `publicRoutes: ['/', '/about']` — bypass authentication checks.
- `afterAuth(auth, req, evt)` — post-auth redirects or role checks.

### User Management
- `useUser()` — `user.fullName`, `user.imageUrl`, `user.emailAddresses`, `user.publicMetadata`.
- `user.update({ firstName, lastName })` — update profile.
- User metadata: `publicMetadata`, `privateMetadata`, `unsafeMetadata` — typed via `user.update`.
- Session management: `useSession()` / `useSessionList()` for multi-session UI.

### Organizations
- `<OrganizationSwitcher />` / `<OrganizationProfile />` — org UI components.
- `useOrganization()` — `organization.id`, `organization.name`, `organization.membersCount`.
- `useOrganizationList()` — list orgs; `setActive({ organization })` — switch context.
- `useMembership({ membership })` / `useInvitations()` — manage org membership.

### Webhooks
- Clerk webhook events: `user.created`, `user.updated`, `organization.created`, `session.created`.
- Endpoints via `svix`: verify `svix-headers` signature.
- Sync users to DB: upsert on `user.created` / `user.updated`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.