कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

sr-next-clerk-expert

michaelmonetized द्वारा

Web & Frontend Development
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Senior-level Clerk authentication expertise for Next.js 15/16+ applications.

विवरण

यह स्किल क्या करती है

Provides senior-level patterns for implementing Clerk authentication in Next.js 15/16+ apps. Covers route protection, middleware configuration, client vs server auth boundaries, and integration with Convex and Stripe. Includes a set of rules that prevent common auth failures like 500 errors, infinite redirects, and handshake loops.

Encodes hard-won production rules that are not obvious from Clerk's official docs, preventing outages caused by calling auth() on public pages or skipping ClerkLoaded wrappers.

इसे कब इस्तेमाल करें

  • Protecting dashboard routes while keeping marketing pages public
  • Migrating from middleware.ts to proxy.ts for Next.js 16+
  • Debugging Clerk handshake redirects and 500 errors in production
  • Adding Stripe billing flows to an existing Clerk-authenticated app
  • Syncing Clerk users to a Convex database via webhooks

उदाहरण वर्कफ़्लो

इनपुट

User asks: How do I protect my dashboard routes but keep the homepage public in Next.js 16+?

एजेंट
  1. 1

    Creates app/(private)/ route group containing dashboard and settings pages

  2. 2

    Generates proxy.ts using clerkMiddleware that only protects /(private)(.*) routes

  3. 3

    Creates app/(private)/layout.tsx that calls auth() and redirects unauthenticated users

  4. 4

    Updates app/page.tsx to use SignedIn/SignedOut inside ClerkLoaded instead of calling auth()

  5. 5

    Provides verification checklist to test anonymous access before deploying

आउटपुट

Working route protection setup where public pages remain static and only private routes require authentication

आवश्यकताएँ

  • CLERK_SECRET_KEY environment variable (from Clerk Dashboard)
  • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY environment variable (from Clerk Dashboard)
  • Clerk account

इंस्टॉलेशन

clawhub install michaelmonetized/sr-next-clerk-expert

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक