hey @fmerian how do you handler data sync from clerk to the database in golang via webhooks? there aren't many good resources out there which explains this, couldn't find a go example in official repo as well.
It shows how to parse the user.created and organization.created events into Go structs so you can handle them however you need. You'd need to create the structs for any other events you want to parse, but you can do this pretty easily with ChatGPT and the samples provided in the Webhooks section of our dashboard.
I'm going to push to get something more official but this should at least get you going. Hope it helps!
Hey there! I'll get working on a demo to share! In the meantime, I do have some resources that might help move you in the right direction before I can spin up a more official guide.
Downside is I did not actually verify the webhook (which I sorely regret now π ). Luckily, this guide shows how to do just that: svix.com/guides/receiving/receive-...
I'll be out of town this coming week but will do my best to get a functional example working!
thanks for this tutorial, @marcuskohlberg! we just featured it on our latest product update here π
fun fact: Clerk's backends are written in Go and the backend that powers our Dashboard experience is a heavy consumer of our open-source Clerk Go SDK!
Awesome, thanks for sharing!
hey @fmerian how do you handler data sync from clerk to the database in golang via webhooks? there aren't many good resources out there which explains this, couldn't find a go example in official repo as well.
Give this a look and let me know if you have any questions!
github.com/bmorrisondev/clerk-go-w...
It shows how to parse the
user.createdandorganization.createdevents into Go structs so you can handle them however you need. You'd need to create the structs for any other events you want to parse, but you can do this pretty easily with ChatGPT and the samples provided in the Webhooks section of our dashboard.I'm going to push to get something more official but this should at least get you going. Hope it helps!
ping @brianmmdev
@brianmmdev ^^ , would love to get a proper official go guide on this
Hey there! I'll get working on a demo to share! In the meantime, I do have some resources that might help move you in the right direction before I can spin up a more official guide.
I wrote for the PlanetScale blog a while back about receiving webhooks with Go: planetscale.com/blog/sync-user-dat...
Downside is I did not actually verify the webhook (which I sorely regret now π ). Luckily, this guide shows how to do just that: svix.com/guides/receiving/receive-...
I'll be out of town this coming week but will do my best to get a functional example working!
Thanks Brian, the code demo helped a lot!
@brianmmdev is the π