auth

Implements Clerk, Descope, and Auth0 authentication for Next.js applications on Vercel.

Updated Sep 5, 2026
One-click install
npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill auth-dsgalkar
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: auth
Source: https://github.com/dsgalkar/dnyaneshwar_portfolio/tree/main/.agents/plugins/vercel/skills/auth
Command: npx skills add https://github.com/dsgalkar/dnyaneshwar_portfolio --skill auth-dsgalkar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding user authentication to a Next.js application involves choosing a provider, configuring middleware, protecting routes, and handling sign-in flows, and mistakes in any of these steps leave routes exposed or sessions broken. ## Core Features & Use Cases - Provider Setup Guidance: Step-by-step integration for Clerk (native Vercel Marketplace), Descope, and Auth0, including SDK installation, environment variables, and provider components. - Middleware and Route Protection: Patterns for clerkMiddleware, createRouteMatcher, Descope authMiddleware, and Auth0 middleware to secure pages and API routes. - Migration and Validation Rules: Detects legacy next-auth v4, manual JWT handling, bcrypt password hashing, and hand-rolled Vercel OAuth, then directs to managed auth with Clerk Core 3 breaking-change guidance. - Use Case: You need login on your Next.js dashboard. The Skill provisions Clerk via the Vercel Marketplace, wires up middleware protection for /dashboard routes, and adds pre-built SignIn and SignUp pages. ## Quick Start Add Clerk authentication with protected dashboard routes and sign-in pages to my Next.js app.

Frequently Asked Questions about auth

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

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

Install Clerk from the Vercel Marketplace with vercel integration add clerk, which auto-provisions environment variables, then add @clerk/nextjs, wrap your layout in ClerkProvider, and configure clerkMiddleware in middleware.ts to protect routes.

Clerk vs Auth0 vs Descope for Next.js authentication?▼

Clerk offers the fastest Vercel setup with native Marketplace integration and pre-built UI components. Descope suits passwordless and visual flow-builder needs, while Auth0 fits enterprise SSO, SAML, and multi-tenant identity requirements.

How do I protect API routes in Next.js middleware?▼

Use clerkMiddleware with createRouteMatcher to match protected paths like /api(.*), then call await auth.protect() inside the handler. In route handlers, call await auth() and return a 401 response when userId is absent.

Does Clerk v7 require code changes when upgrading?▼

Yes, Clerk Core 3 makes auth() and clerkClient() asynchronous, removes authMiddleware in favor of clerkMiddleware, and deprecates @clerk/types. Run npx @clerk/upgrade to apply codemods automatically; Node.js 20.9.0 or later is required.

Why should I avoid manual JWT or bcrypt password handling?▼

Manual JWT signing and bcrypt hashing lack built-in CSRF protection, token rotation, rate limiting, and breach detection. Managed providers like Clerk or Auth0 handle these security concerns and reduce the risk of implementation errors.