clerk-webhooks

Implements verified Clerk webhook handlers for user, organization, and billing event synchronization.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/divinaarmuela/Content --skill clerk-webhooks-divinaarmuela
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-webhooks
Source: https://github.com/divinaarmuela/Content/tree/main/.claude/skills/clerk-webhooks
Command: npx skills add https://github.com/divinaarmuela/Content --skill clerk-webhooks-divinaarmuela

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building webhook endpoints for Clerk authentication events requires correct signature verification, raw body parsing, public route configuration, and framework-specific adapters, and mistakes in any of these cause silent failures or security holes. ## Core Features & Use Cases - Signature-Verified Handlers: Generates complete webhook handlers using verifyWebhook from the framework-specific Clerk package, reading CLERK_WEBHOOK_SIGNING_SECRET automatically. - Full Event Catalog: Covers user, session, organization, organization membership, subscription, subscription item, and payment attempt events with typed payload field references. - Multi-Framework Support: Provides handler examples for Next.js, Express, Astro, Fastify, Nuxt, React Router, and TanStack Start, including pitfalls like express.raw versus express.json. - Use Case: Sync new signups to a Postgres users table via Prisma, send welcome emails through Resend, and post Slack notifications when user.created fires, all from one verified endpoint. ## Quick Start Set up a verified Clerk webhook handler in my Next.js app that inserts new users into my database when the user.created event fires.

Frequently Asked Questions about clerk-webhooks

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

FAQPage Schema
How do I set up a Clerk webhook handler in Next.js?

Create a POST route at app/api/webhooks/route.ts that calls verifyWebhook(req) from @clerk/nextjs/webhooks, then branch on evt.type such as user.created. Exclude /api/webhooks(.*) from clerkMiddleware protection so the route stays public.

Why does my Clerk webhook return 401 or fail verification in Express?

Express webhook routes must use express.raw({ type: 'application/json' }) instead of express.json(), because signature verification needs the raw body bytes. Also confirm the route is public and CLERK_WEBHOOK_SIGNING_SECRET is set.

Which Clerk webhook events are available for organizations and billing?

Clerk emits organization.created/updated/deleted, organizationMembership events, subscription and subscriptionItem lifecycle events, and paymentAttempt.created/updated. The full catalog also covers user, session, email, sms, waitlist, role, and permission events.

Can I use Clerk webhooks for synchronous onboarding flows?

No, webhooks are asynchronous and eventually consistent, so they should not gate synchronous flows like onboarding. Read data the user just created from the Clerk session token or Backend API, and reserve webhooks for sync, notifications, and integrations.

How do I test Clerk webhooks locally during development?

Run clerk webhooks listen with a token from clerk webhooks token and forward to your local endpoint, then add the printed relay URL as a Dashboard webhook endpoint. Svix headers are preserved so verifyWebhook works against the endpoint's signing secret.

How do I handle duplicate or retried Clerk webhook deliveries?

Svix retries failed deliveries on a fixed schedule, so use the svix-id header as an idempotency key to deduplicate events. Return 2xx to acknowledge success and 4xx or 5xx to trigger a retry, and replay failures from the Clerk Dashboard.