BuzzTrip uses a single HTTP webhook endpoint to keep Convex user records in sync with Clerk. When a user’s account is created, updated, or deleted in Clerk, a signed webhook payload is delivered to the Convex HTTP router, which validates the signature and dispatches the appropriate internal mutation. Without this webhook, authenticated users will have no Convex user record and all data operations will fail.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jacobsamo/buzztrip/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
convex/http.ts and served at your Convex HTTP deployment URL (distinct from your Convex query/mutation URL — it ends in .convex.site rather than .convex.cloud).
Full URL format:
Supported Events
| Event | Internal Mutation | What Happens |
|---|---|---|
user.created | internal.users.createUser | Creates user record, sends welcome email, creates default “Main map” |
user.updated | internal.users.updateUser | Patches name, email, image, username, and updatedAt on the user document |
user.deleted | internal.users.deleteUser | Deletes the user record from Convex (logs warning if not found) |
| All other events | — | Logged and ignored |
Webhook Validation
Incoming webhook requests are validated using the Svix library before any mutation is run. The handler reads the raw request body and verifies the Svix signature headers againstCLERK_WEBHOOK_SECRET.
Required headers (sent automatically by Clerk):
| Header | Description |
|---|---|
svix-id | Unique message ID for idempotency |
svix-timestamp | Unix timestamp of the delivery attempt |
svix-signature | HMAC-SHA256 signature over svix-id.svix-timestamp.body |
400 and no mutation is run. On success it returns HTTP 200.
convex/http.ts
Setup
Find your Convex HTTP URL
Open your Convex dashboard, select your deployment, and go to Settings. Your HTTP Actions URL looks like:This is different from the
NEXT_PUBLIC_CONVEX_URL in your .env.local, which ends in .convex.cloud.Open Clerk Webhooks
In your Clerk dashboard, navigate to Webhooks in the left sidebar, then click Add Endpoint.
Select events
Under Subscribe to events, enable the following three events:
user.createduser.updateduser.deleted
Copy the Webhook Secret
After saving the endpoint, Clerk will display a Signing Secret (starts with
whsec_). Copy it — you will need it in the next step.Set CLERK_WEBHOOK_SECRET in Convex
In your Convex dashboard, go to Settings → Environment Variables and add:
This variable must be set in the Convex dashboard, not in your local
| Key | Value |
|---|---|
CLERK_WEBHOOK_SECRET | whsec_... (the secret you copied from Clerk) |
.env.local file. Convex functions do not have access to your Next.js environment variables.Testing the Webhook
- Clerk Dashboard
- Live Sign-Up
Clerk provides a built-in test tool for registered endpoints. In your Clerk dashboard:
- Go to Webhooks and select your endpoint
- Click Testing in the top tab bar
- Select
user.createdfrom the event dropdown - Click Send Example and check the response
200. If you see 400, check that CLERK_WEBHOOK_SECRET is set correctly in Convex.