YeetCode
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

  1. In the Clerk dashboard, go to JWT Templates.
  2. Select the Convex template.
  3. Copy the Issuer domain URL (e.g. https://your-app.clerk.accounts.dev).
  4. In your Convex dashboard, go to Settings → Environment Variables and create CLERK_JWT_ISSUER_DOMAIN with the issuer URL you copied.

Webhook Endpoint

  1. In the Clerk dashboard, go to Configure → Developer → Webhooks.
  2. Click Create new webhook.
  3. 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/clerk to it, so the full URL looks like:
      https://<your-deployment>.convex.site/webhook-events/clerk
  4. Under Subscribe to events, select:
    • user.created
    • user.deleted
  5. Save the webhook.
  6. Copy the Signing Secret from the newly created webhook.
  7. In your Convex dashboard, add it as the CLERK_WEBHOOK_SECRET environment variable.

On this page