The Clerk source enables you to receive Clerk webhook events in Knock and map them to actions like triggering workflows, identifying users, and managing tenants. Knock provides a pre-built integration with webhook verification and event-to-action mappings ready to use.
- A Clerk account with access to the Webhooks settings
- A Knock account with at least one workflow configured
Create the source in Knock
Navigate to Integrations > Sources in your Knock dashboard and click "Create source." Select Clerk from the list of pre-built integrations.
Copy the webhook URL
Copy the webhook URL for the Knock environment you want to configure.
Add the webhook endpoint in Clerk
In your Clerk Dashboard, go to Webhooks and click "Add Endpoint." Paste the Knock webhook URL and select the event types you want to subscribe to.
Copy the signing secret
After creating the endpoint in Clerk, copy the Signing Secret from the endpoint details page.
Paste the signing secret in Knock
Back in the Knock dashboard, paste the Clerk signing secret into the source configuration. Knock uses this to verify that incoming webhooks are from Clerk.
Review event mappings
Review the pre-configured event-to-action mappings and enable the ones relevant to your use case.
The Clerk source comes with mappings for common Clerk webhook event types. You can enable or disable each mapping independently.
| Clerk event | Suggested action | Description |
|---|
user.created | Identify user | Creates a user in Knock when a new user signs up via Clerk |
user.updated | Identify user | Updates user properties in Knock when profile details change |
user.deleted | Trigger workflow | Notifies relevant parties when a user account is deleted |
session.created | Trigger workflow | Triggers a workflow when a user starts a new session |
organization.created | Set tenant | Creates a tenant in Knock when a new Clerk organization is created |
organization.updated | Set tenant | Updates tenant properties in Knock when organization details change |
organizationMembership.created | Subscribe user | Subscribes a user to a tenant when they join an organization |
organizationMembership.deleted | Unsubscribe user | Unsubscribes a user from a tenant when they leave an organization |
You can modify any of the pre-configured mappings or create new ones for additional Clerk event types. When customizing field mappings, use dot notation to reference nested fields in the Clerk webhook payload (e.g. data.email_addresses[0].email_address).
For details on building custom event-action mappings and field mapping, see the custom webhooks documentation.