Setup
3. Connect Clerk to Convex
Connect Clerk authentication to your Convex backend.
Wire Clerk's JWT authentication into Convex so backend functions can identify users, and set up webhooks to sync user lifecycle events.
JWT Template
- In the Clerk dashboard, go to JWT Templates.
- Select the Convex template.
- Copy the Issuer domain URL (e.g.
https://your-app.clerk.accounts.dev). - In your Convex dashboard, go to Settings → Environment Variables and create
CLERK_JWT_ISSUER_DOMAINwith the issuer URL you copied.
Webhook Endpoint
- In the Clerk dashboard, go to Configure → Developer → Webhooks.
- Click Create new webhook.
- For the endpoint URL:
- In your Convex dashboard, go to Settings → General and find the Actions URL — make sure you copy the HTTPS URL (it ends with
.site). - Append
/webhook-events/clerkto it, so the full URL looks like:https://<your-deployment>.convex.site/webhook-events/clerk
- In your Convex dashboard, go to Settings → General and find the Actions URL — make sure you copy the HTTPS URL (it ends with
- Under Subscribe to events, select:
user.createduser.deleted
- Save the webhook.
- Copy the Signing Secret from the newly created webhook.
- In your Convex dashboard, add it as the
CLERK_WEBHOOK_SECRETenvironment variable.