Clerk
Set up webhooks to receive notifications for user authentication events from Clerk
Integration Guide
This guide will walk you through setting up a webhook integration between Clerk and HookFlo, enabling you to receive alerts for user authentication and management events.
Clerk uses Svix to manage their webhook infrastructure, so the webhooks will include Svix-specific headers that HookFlo will validate.
Prerequisites
- A HookFlo account with an active project
- A Clerk account with admin access to your application
- Basic understanding of Clerk’s authentication system
Integration Overview
The integration process follows these key steps:
- Set up a webhook in HookFlo
- Configure notification channels (email/Slack)
- Connect Clerk to HookFlo
- Configure Clerk to send webhooks
- Test the integration
Setting Up Your HookFlo Webhook
After logging into HookFlo, follow these steps to create and configure your Clerk webhook:
Create a Webhook
Setup Notification Channel
Connect your Webhook with application
Configuring Clerk
Now that your HookFlo webhook is set up, you need to configure Clerk to send events to it:
Create a Webhook Endpoint in Clerk
Get Signing Secret from Clerk
Configure Webhook Verification in HookFlo
Testing Your Integration
To ensure your integration is working properly:
Test the Webhook in Clerk
Verify in HookFlo
Supported Events
Clerk supports a wide range of webhook events. Here are the most commonly used categories:
User Events
user.created
: When a new user is createduser.updated
: When user details are changeduser.deleted
: When a user is deleteduser.locked
: When a user account is locked
Session Events
session.created
: When a user signs insession.removed
: When a user signs outsession.ended
: When a session expires
Authentication Events
emailAddress.created
: When an email address is addedemailAddress.verified
: When an email is verifiedphoneNumber.created
: When a phone number is addedphoneNumber.verified
: When a phone is verifiedpassword.created
: When a password is setpassword.reset
: When a password is reset
Organization Events
organization.created
: When a new organization is createdorganization.updated
: When an organization is updatedorganization.deleted
: When an organization is deletedorganizationMembership.created
: When a user joins an organizationorganizationMembership.deleted
: When a user leaves an organization
For a complete list of events, refer to the Clerk Webhook Events documentation.
Webhook Headers
Clerk webhooks include these important headers that HookFlo uses for verification:
svix-id
: A unique identifier for the webhook eventsvix-timestamp
: When the webhook was sentsvix-signature
: A signature that proves the webhook came from Clerk
Webhook Payload Structure
Here’s an example of what the webhook payload looks like for a user.created
event:
Advanced Configuration
Troubleshooting
Example: Monitoring New User Signups
Here’s a complete example of setting up HookFlo to alert your team when new users sign up:
Create the Webhook in HookFlo
Follow the steps above to create a Clerk webhook in HookFlo and configure your notification channels.
Configure Clerk to Send User Events
- In your Clerk dashboard, go to Webhooks
- Create a new webhook using your HookFlo webhook URL
- Select the
user.created
event type - Copy your webhook signing secret
- Add the signing secret to your HookFlo Clerk configuration
Test With a New User
- Create a new test user in your Clerk application
- Check your configured notification channels for alerts
- Verify the event appears in your HookFlo notification logs
Security Considerations
When setting up webhook integrations between Clerk and HookFlo, keep these security best practices in mind:
- Protect your signing secret: Never expose the Clerk signing secret in client-side code
- Validate all webhooks: Always use the signing secret to verify webhook authenticity
- Use HTTPS only: Ensure all webhook URLs use encrypted connections
- Implement proper access controls: Limit who can view sensitive user information
- Monitor webhook activity: Regularly review webhook events for suspicious patterns
Congratulations! 🎉
You’ve successfully set up real-time authentication event tracking and alerting between Clerk and HookFlo in just a few minutes. Your team can now receive immediate notifications about important user events, helping you respond quickly to critical situations.
Need more help? Contact our support team or join our Discord forum or DM me directly on X.