moai-platform-clerk

Implement Clerk authentication with WebAuthn, passkeys, and organizations in Next.js applications.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/h102-log/pdfrag --skill moai-platform-clerk-h102-log
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-platform-clerk
Source: https://github.com/h102-log/pdfrag/tree/main/.claude/skills/moai-platform-clerk
Command: npx skills add https://github.com/h102-log/pdfrag --skill moai-platform-clerk-h102-log

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @clerk/nextjs, svix, and includes references (resource) components.

What problem does it solve? Setting up modern authentication with passkeys, passwordless flows, and multi-tenant organizations requires navigating Clerk's Core 2 SDK changes, middleware configuration, and webhook integration, which is error-prone without structured guidance. ## Core Features & Use Cases - Clerk Core 2 Setup: Configure ClerkProvider, clerkMiddleware with createRouteMatcher, and environment variables for Next.js App Router projects. - Advanced Auth Patterns: Implement WebAuthn passkeys, custom sign-in/sign-up flows with useSignIn and useSignUp, and role-based access control via auth.protect(). - Organizations & Webhooks: Build organization switching with OrganizationSwitcher and sync users to your database using Svix-verified webhook handlers. - Use Case: You are building a Next.js 15 SaaS dashboard and need protected routes, passkey sign-in, and organization management—this Skill provides working code for each piece. ## Quick Start Ask the AI to set up Clerk authentication in your Next.js app with protected dashboard routes and a sign-in page.

Frequently Asked Questions about moai-platform-clerk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Clerk authentication in a Next.js app?▼

Install @clerk/nextjs, set NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY in .env.local, wrap your root layout with ClerkProvider, and add clerkMiddleware in middleware.ts to protect routes.

How do I protect routes with Clerk middleware?▼

Use clerkMiddleware with createRouteMatcher from @clerk/nextjs/server to define public or protected route patterns, then call auth.protect() for requests requiring authentication. Role and permission checks can be added via the has() callback.

Does Clerk support passkeys and WebAuthn sign-in?▼

Yes, Clerk supports passkeys after enabling them in the Clerk Dashboard under authentication settings. Users create passkeys with user.createPasskey() and sign in via signIn.authenticateWithPasskey().

How do I migrate from Clerk Core 1 to Core 2?▼

Run npx @clerk/upgrade --from=core-1 to automate migration. Key changes include replacing authMiddleware with clerkMiddleware, moving server imports to @clerk/nextjs/server, and renaming profileImageUrl to imageUrl.

How do I sync Clerk users to my database with webhooks?▼

Create a webhook route handler that verifies Svix signatures using the CLERK_WEBHOOK_SECRET, then handle events like user.created, user.updated, and user.deleted to upsert or remove records in your database.

What are the version requirements for @clerk/nextjs 6.x?▼

@clerk/nextjs 6.x with Core 2 requires Next.js 13.0.4 or higher, React 18 or higher, and Node.js 18.17.0 or higher. Older environments must upgrade before adopting Core 2.