Need clerk webhook example
I have been trying to configure a webhook to be called as soon an organization has been created and the webhook should call a prisma query to do a DB entry but I couldnt find any example that would help me configure this.
I am using pages router.
5 Replies
I know for sure there are examples in the clerk server (maybe even in the clerk docs) maybe even in here too
just search for them and see what you can find
here is what I have in a code base I wrote 3 months ago following something from the clerk server
@whatplan (Rustular Devrel) this works locally ??
cos i used the code but somehow it not running
I don't have an example in the current docs that is super in depth but this new doc here:
https://beta-docs.clerk.com/users/guides/sync-data-to-your-backend
Tells you how to use everything, note that testing locally you need to expose your endpoint outside of your local application as a webhook is a reverse API
Sync data to your backend with webhooks | Clerk
Authentication and User management for the modern web
@James Perkins , Thanks.
I was missing the ngrok. This docs helped me to fix it.
Hey everyone, when I sync clerk data to my back end using webhook and do all steps i receive 401 error on vercel Log
and this is my link of problem on stackoverflow :
https://stackoverflow.com/questions/77768548/401-unauthorised-when-processing-a-clerk-webhook-in-next-js
Stack Overflow
401 Unauthorised when processing a Clerk Webhook in Next.js
when i sync clerk data to my back end using webhook and do all steps i recive 401 error on vercel Log
this is app/api/webhook/route.ts
/* eslint-disable camelcase */
import { Webhook } from "s...