clerk-setup

Configure Clerk authentication in web projects using CLI provisioning and official quickstart guides.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill clerk-setup-dimonikrv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-setup
Source: https://github.com/DimonikRV/ghost-pilot-project/tree/main/.agents/skills/clerk-setup
Command: npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill clerk-setup-dimonikrv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding authentication to a web application involves framework-specific SDK choices, environment variable setup, middleware configuration, and provider placement that vary across Next.js, React, Vue, Astro, Express, and other stacks. This Skill automates Clerk integration by detecting the framework, provisioning apps via the Clerk CLI, and following the official quickstart for each platform. ## Core Features & Use Cases - CLI-driven provisioning: Uses clerk init, clerk link, and clerk env pull to create or link Clerk applications and write framework-correct environment variables automatically. - Framework detection and quickstart execution: Reads package.json to identify the framework (Next.js, React Router, Astro, Nuxt, Vue, Express, Fastify, Expo, and more) and fetches the matching official quickstart guide. - Migration planning: Audits existing auth providers (NextAuth, Supabase, Firebase, Auth0) and produces a migration plan covering user export, password hashes, and session transition. - Use Case: A developer creates a new Next.js app and asks to add authentication. The Skill installs @clerk/nextjs, places ClerkProvider inside <body>, creates proxy.ts middleware, and sets up .env.local keys via the CLI or Keyless mode. ## Quick Start Ask the agent to add Clerk authentication to your project and it will detect your framework, provision keys, and configure the SDK automatically.

Frequently Asked Questions about clerk-setup

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

FAQPage Schema
How do I add Clerk authentication to a Next.js app?▼

Install @clerk/nextjs, place ClerkProvider inside the <body> of your root layout, and create proxy.ts (middleware.ts for Next.js 15 or earlier) with clerkMiddleware. Set NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY in .env.local, or let the clerk init CLI handle provisioning.

How do I migrate from NextAuth to Clerk?▼

Audit your existing auth touchpoints, export users via the Clerk Backend API, and store legacy IDs as external_id. Choose between a big-bang switch or trickle migration running both systems temporarily; existing sessions will terminate during the switch.

Which Clerk package should I install for React, Vue, or Express?▼

Use @clerk/nextjs for Next.js, @clerk/react for React SPAs, @clerk/expo for Expo, @clerk/react-router for React Router v7, and @clerk/tanstack-react-start for TanStack Start. Express and Fastify have their own dedicated SDKs documented in the quickstarts.

Does Clerk work with Vite-based React SPAs without a server?▼

Yes, React SPAs use @clerk/react with ClerkProvider wrapping the app root and a publishable key passed as a prop. No middleware is needed, and the CLI writes VITE_CLERK_PUBLISHABLE_KEY to the appropriate env file automatically.

Why is my Clerk middleware not protecting routes in Next.js?▼

Common causes include a missing or incorrect middleware matcher, forgetting to await auth() in Next.js 15+, or not allowing /sign-in and /sign-up as public routes. Run clerk doctor to check framework integration, env vars, and middleware presence.

What Node.js version does Clerk require?▼

The current Clerk SDK requires Node.js 20.9.0 or higher. Projects on the older Core 2 SDK could run on Node.js 18.17.0, but upgrading Node is recommended when moving to current packages.