Hook to sync users on external database

Hi,
I’d like to sync the registered users to an external database, using a backend-to-backend connection.
Is there a hook or trigger that I can use in Stytch to add or update users’ data in my external database?

Best

Hey Giulio,

Thanks so much for posting!

Our backend SDKs don’t have hooks that parallel our frontend SDK hooks (like useStytchUser), but we’d generally recommend implementing database calls in your backend integration on whichever events would correspond to a relevant update to the users stored in your database (you can use the Stytch user_id as the unique identifier).

For instance, if you’re only interested in capturing the user_id and associating it with your own user database, you might implement database calls during your user creation and deletion flows. If you’d like to store their email addresses, you might want to implement database calls when you make a backend Stytch API call to add (or remove) an email address to their Stytch user.

I hope this helps - please let us know if you have any further questions about this!