Agent skill · Data & Analytics

clerk-sdk-patterns

Common Clerk SDK patterns and best practices. Use when implementing authentication flows, accessing user data, or integrating Clerk SDK methods in your application. Trigger with phrases like "clerk SDK", "clerk patterns", "clerk best practices", "clerk API usage".

majiayu000github.com/majiayu000GitHub ↗
claude-codecan modify filesMIT
Install
npx skills add majiayu000/claude-skill-registry --skill clerk-sdk-patterns-vasic-digital-superagent-2 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Version: 1.0.0
Declared author: Jeremy Longshore <jeremy@intentsolutions.io>
Allowed tools: ReadWriteEditGrep
Path: skills/api/clerk-sdk-patterns-vasic-digital-superagent-2/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Clerk SDK Patterns ## Overview Learn common patterns and best practices for using the Clerk SDK effectively. ## Prerequisites - Clerk SDK installed and configured - Basic understanding of React/Next.js - ClerkProvider wrapping application ## Instructions ### Pattern 1: Server-Side Authentication ```typescript // app/api/protected/route.ts import { auth, currentUser } from '@clerk/nextjs/server' export async function GET() { // Quick auth check const { userId, sessionId, orgId } = await auth() if (!userId) { return Response.json({ error: 'Unauthorized' }, { status: 401 }) } // Full user data when needed const user = await currentUser() return Response.json({ userId, sessionId, orgId, email: user?.primaryEmailAddress?.emailAddress }) } ``` ### Pattern 2: Client-Side Hooks ```typescript 'use client' import { useUser, useAuth, useClerk, useSession } from '@clerk/nextjs' export function AuthenticatedComponent() { // User data and loading state const { user, isLoaded, isSignedIn } = useUser() // Auth utilities const { userId, getToken, signOut } = useAuth() // Full Clerk instance const clerk = useClerk() // Session info const { session } = useSession() // Get JWT token for API calls co

What's inside
Steps it walks through
  1. Overview
  2. Prerequisites
  3. Instructions
  4. Pattern 1: Server-Side Authentication
  5. Pattern 2: Client-Side Hooks
  6. Pattern 3: Protected Routes with Middleware
  7. Pattern 4: Organization-Aware Queries
  8. Pattern 5: Custom JWT Templates
  9. Output
  10. Error Handling
  11. Examples
  12. Complete Protected Page Pattern
  13. Typed User Metadata
  14. Resources
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the clerk-sdk-patterns skill do?

Common Clerk SDK patterns and best practices. Use when implementing authentication flows, accessing user data, or integrating Clerk SDK methods in your application. Trigger with phrases like "clerk SDK", "clerk patterns", "clerk best practices", "clerk API usage".

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill clerk-sdk-patterns-vasic-digital-superagent-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going