clerk-setup

Adds Clerk authentication to projects using CLI provisioning and official framework quickstarts.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/Rajaryan1726/ai-code-review-system --skill clerk-setup-rajaryan1726
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-setup
Source: https://github.com/Rajaryan1726/ai-code-review-system/tree/main/client/.agents/skills/clerk-setup
Command: npx skills add https://github.com/Rajaryan1726/ai-code-review-system --skill clerk-setup-rajaryan1726

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up authentication from scratch is error-prone: wrong SDK packages, misplaced providers, missing middleware, and leaked secret keys are common mistakes. This Skill automates Clerk integration by detecting your framework, provisioning API keys via the Clerk CLI, and following the official quickstart for your stack. ## Core Features & Use Cases - CLI-driven provisioning: Uses clerk init, clerk link, and clerk env pull to install SDKs, write framework-specific env vars, and generate temporary development keys without requiring a Clerk account. - Framework detection and quickstart execution: Reads package.json to identify Next.js, React, Vue, Nuxt, Astro, Express, Fastify, Expo, and more, then follows the matching official quickstart. - Migration planning: Audits existing auth (NextAuth, Supabase, Firebase, Auth0) and plans user data migration via the Clerk Backend API with big-bang or trickle strategies. - Use Case: You scaffold a new Next.js SaaS app and ask the agent to add authentication. It runs clerk init --framework next, places ClerkProvider inside <body>, creates proxy.ts middleware, writes keys to .env.local, and applies the shadcn theme if components.json exists. ## Quick Start Ask the agent to add Clerk authentication to your project and it will detect the framework, provision keys, and wire up 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?▼

Run `clerk init --framework next` to install @clerk/nextjs and write keys to .env.local, or follow the manual quickstart. Place ClerkProvider inside the `<body>` of your root layout and create proxy.ts (middleware.ts on Next.js 15 or earlier) with clerkMiddleware.

How do I set up Clerk without creating a Clerk account?▼

Run `clerk init` unauthenticated and it writes temporary development keys to your project's env file with no login or browser required. When you later run `clerk auth login`, the app is claimed into your Clerk account automatically.

Can I migrate from NextAuth to Clerk without losing users?▼

Yes. Audit your existing auth touchpoints, export users and import them via the Clerk Backend API, and store legacy IDs as external_id. Choose a big-bang switch or trickle migration; note that existing sessions terminate on switch.

Which Clerk package should I install for a React SPA with Vite?▼

Install @clerk/react (not @clerk/nextjs) and wrap your app root with ClerkProvider passing the publishable key. SPAs need no middleware; set VITE_CLERK_PUBLISHABLE_KEY in your .env file.

Why is my Clerk integration failing after setup?▼

Run `clerk doctor --json` to check framework integration, env vars, middleware presence, and SDK install status. Common causes include missing await on auth(), ClerkProvider wrapping `<html>` instead of inside `<body>`, and exposing CLERK_SECRET_KEY in client code.

What Node.js version does Clerk require?▼

Clerk requires Node.js 20.9.0 or higher for current SDK versions. Projects on the older Core 2 SDK have a lower minimum of Node.js 18.17.0.