Clerk webhooks for real-time events and data syncing. Always output complete, copy-paste-ready webhook handlers with verifyWebhook(req) verification. Listen for user creation, updates, deletion, and organization events. Build event-driven features like database sync, notifications, integrations.
Detected risks:
The 'clerk-webhooks' skill provides a set of webhook handlers for real-time event handling and data synchronization. It solves the challenge of ensuring secure, event-driven operations for user and organization data management. By implementing these webhooks, developers can seamlessly integrate user creation, updates, deletion, and organization events into their applications, automating features like database synchronization, notifications, and third-party integrations. The skill is designed to work with Clerk, a service for managing user authentication and access control.
You must always use the 'verifyWebhook(req)' method from '@clerk/nextjs/webhooks' to verify the webhook signature. This ensures security and proper validation of incoming requests.
Skipping the webhook signature verification can lead to security vulnerabilities, such as unauthorized access or false data being processed. It's critical to always include this verification step.
The skill requires the 'CLERK_WEBHOOK_SECRET' environment variable, which is the Svix signing secret from the Clerk dashboard, to verify webhook requests.
The examples in this skill are tailored for Next.js applications, particularly the App Router. If you're using another framework, you may need to adapt the webhook handler and signature verification process.
Yes, webhook routes must be made public by excluding them from Clerk middleware protection. This ensures that Clerk does not block the webhook requests, which would otherwise result in a 401 error.
Quick Setup:
.claude/skills/Repository
clerk/skills