clerk-setup

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

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Ramadan-Elgamal/Autobees --skill clerk-setup-ramadan-elgamal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-setup
Source: https://github.com/Ramadan-Elgamal/Autobees/tree/main/.agents/skills/clerk-setup
Command: npx skills add https://github.com/Ramadan-Elgamal/Autobees --skill clerk-setup-ramadan-elgamal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding authentication to a project requires framework-specific setup steps, correct SDK package selection, environment variable configuration, and middleware placement, all of which vary across Next.js, React, Astro, Express, and other frameworks. This Skill automates that setup by detecting the framework and following the official Clerk quickstart, or by using the clerk CLI to provision apps and keys end to end. ## Core Features & Use Cases - Framework Detection and Setup: Reads package.json to identify the framework (Next.js, React, Vue, Nuxt, Astro, Express, Fastify, Expo, and more), then fetches and follows the matching official quickstart guide. - CLI-Driven Provisioning: Uses the clerk CLI to create or link Clerk applications, pull environment variables, rotate secret keys, and run integration health checks with clerk doctor. - Auth Migration Planning: Detects existing auth providers like NextAuth, Supabase, Firebase, or Auth0 and produces a migration plan covering user export, password hashes, external IDs, and session transition. - Use Case: A developer with a new Next.js app asks to add authentication. The Skill installs @clerk/nextjs, places ClerkProvider inside the body tag of the root layout, creates proxy.ts or middleware.ts, configures environment keys, and applies the shadcn theme if components.json exists. ## Quick Start Add Clerk authentication to my project by detecting the framework from package.json and following the official quickstart setup steps.

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 tag of your root layout, and create proxy.ts (middleware.ts on Next.js 15 or earlier) with clerkMiddleware. Set NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY in .env.local, or let Keyless mode generate dev keys automatically.

How do I migrate from NextAuth to Clerk?

Audit your existing auth touchpoints first, then export users and import them through the Clerk Backend API, storing legacy IDs as external_id. Clerk can upgrade password hashes to Bcrypt transparently. Choose between a big-bang switch or trickle migration, noting that existing sessions will terminate.

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

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 Astro have their own integrations covered by their respective quickstart guides.

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

Yes. Install @clerk/react, wrap your app root with ClerkProvider, and pass the publishable key via the VITE_CLERK_PUBLISHABLE_KEY environment variable. No middleware or server components are needed for single-page applications.

Why is my Clerk auth() call failing in Next.js?

In Next.js 15 and later, auth() is asynchronous, so you must write const { userId } = await auth(). Also verify ClerkProvider sits inside the body tag, server code imports from @clerk/nextjs/server, and your middleware matcher includes API routes.

What Node.js version does Clerk require?

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