Webhooks issue: Given clerk dev keys + convex production keys in Vercel
Background:
I'm building a Next.js project with Clerk for authentication and Convex as the backend. During local development, I set up webhooks between Clerk and Convex to automatically save user data to the database when someone signs up. Everything was working perfectly locally with both services in development mode.
What I Did:
1. Ran
npm run build - everything built successfully2. Ran
npx convex deploy - pushed all functions and schema to Convex production3. Deployed to Vercel with:
- Clerk development keys (because Clerk production requires a custom domain, not
.vercel.app)- Convex production keys
4. Configured the webhook in Clerk dev dashboard to point to Convex production URL
5. Set the webhook signing secret correctly in Convex production environment dashboard.
The Problem:
After deployment, when users sign up on the live site, they're not being saved to the database. The webhooks that worked perfectly locally are now failing.
What I've Checked:
- Webhook URL is correct in Clerk dev dashboard
- Signing secret matches between Clerk and Convex
- Events are selected (user.created, user.updated, etc.)
- Convex production instance is running fine
What I'm Thinking:
The environment mismatch (Clerk dev + Convex prod keys) seems to be the root cause. My current best solution: keep both Clerk AND Convex in development mode on Vercel until I get a custom domain, then migrate both to production together.
My Questions:
1. Can Clerk development webhooks work reliably with Convex production, or is the environment mismatch definitely breaking it?
2. Is keeping both in dev mode the right approach for now?
3. Has anyone successfully run this mixed setup (Clerk dev + Convex prod)
Would really appreciate any insights or experiences you've had with similar setups!
