markjaquith / clerk-sveltekit

Clerk adapter for SvelteKit
Other
145 stars 20 forks source link

Q: How to get SignUp data to store in app db? #73

Open dominicfarr opened 5 days ago

dominicfarr commented 5 days ago

I seem to be missing a step in the sign up flow. How to capture the details of a sign up?

For example: Using <SignUp redirectUrl="/dashboard" /> renders a Sign up form, which Clerk handles and redirects to configured destination.

At what point can I capture this sign up information? I need store it in the app's db?

Is there a call back I assign to the SignUp component? Or do I use a hook?

dominicfarr commented 2 days ago

Webhooks seem to be the most suitable solution. However, given the importance of this step, webhooks are not recommended.
See Clerk Docs on Webhooks if you are onboarding a new user, you can't rely on the webhook delivery as part of that flow. Typically the delivery will happen quickly, but it's not guaranteed to be delivered immediately or at all. Webhooks are best used for things like sending a notification or updating a database, but not for synchronous flows where you need to know the webhook was delivered before moving on to the next step. If you need a synchronous flow, please see our Onboarding Guide as one example of implementing that.