clerk-rate-limits

Featured

Understand and manage Clerk rate limits and quotas. Use when hitting rate limits, optimizing API usage, or planning for high-traffic scenarios. Trigger with phrases like "clerk rate limit", "clerk quota", "clerk API limits", "clerk throttling".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Clerk Rate Limits ## Overview Understand Clerk's rate limiting system and implement strategies to avoid hitting limits. Covers Backend API rate limits, retry logic, batching, caching, and monitoring. ## Prerequisites - Clerk account with API access - Understanding of your application's traffic patterns - Monitoring/logging infrastructure ## Instructions ### Step 1: Understand Rate Limits Clerk Backend API enforces rate limits per API key: | Plan | Rate Limit | Burst | |------|-----------|-------| | Free | 20 req/10s | 40 | | Pro | 100 req/10s | 200 | | Enterprise | Custom | Custom | Rate limit headers returned on every response: - `X-RateLimit-Limit` — max requests per window - `X-RateLimit-Remaining` — remaining requests - `X-RateLimit-Reset` — seconds until window resets ### Step 2: Implement Rate Limit Handling with Retry ```typescript // lib/clerk-api.ts import { createClerkClient } from '@clerk/backend' const clerk = createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY! }) async function withRetry<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T> { for (let attempt = 0; attempt <= maxRetries; attempt++) { try { return await fn() } catch (err: any) { if (err.status === 429 && attempt < maxRetries) { // Parse retry-after header or use exponential backoff const retryAfter = err.headers?.['retry-after'] const waitMs = retryAfter ? parseInt(retryAfter) * 1000 : Math.pow(2, attempt) * 1000 console.warn(...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category