clerk-sdk-patterns

Learn common patterns and best practices for using the Clerk SDK effectively.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "clerk-sdk-patterns" with this command: npx skills add jeremylongshore/claude-code-plugins-plus-skills/jeremylongshore-claude-code-plugins-plus-skills-clerk-sdk-patterns

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

  • Pattern 2: Client-Side Hooks

  • Pattern 3: Protected Routes with Middleware

  • Pattern 4: Organization-Aware Queries

  • Pattern 5: Custom JWT Templates

For full implementation details and code examples, load: Read(${CLAUDE_SKILL_DIR}/references/implementation-guide.md)

Output

  • Server and client authentication patterns

  • Protected route middleware

  • Organization-aware queries

  • Custom JWT tokens for integrations

Error Handling

Error Cause Solution

auth() returns null Not in server context Use in Server Components or API routes

useUser() not updating Component not re-rendering Check ClerkProvider placement

getToken() fails Template not configured Configure JWT template in dashboard

orgId is null No organization selected Prompt user to select organization

Resources

  • Clerk SDK Reference

  • Authentication Patterns

  • JWT Templates

Next Steps

Proceed to clerk-core-workflow-a for user sign-up and sign-in flows.

Examples

Basic usage: Apply clerk sdk patterns to a standard project setup with default configuration options.

Advanced scenario: Customize clerk sdk patterns for production environments with multiple constraints and team-specific requirements.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

backtesting-trading-strategies

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

svg-icon-generator

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

performance-lighthouse-runner

No summary provided by upstream source.

Repository SourceNeeds Review