Post registration hook - post request


I’d like to post a request to my express api to pass in the user metadata to an api endpoint and have that essentially posted to the database. I am wondering how this works from auth0:
A user registers to my app in frontend, the post register hook gets called… but how can i pass this info along? … In addition, I am planning on configuring my rest express api to also authenticate as well.

Please advise.

Thank you!

@SaqibHussain @konrad.sopala
Would appreciate any help for this.
Thank you!

Hey @jerryforcode

Thanks for getting in touch with us at Community :slight_smile:

To get the user_metadata you’ll need to create a rule to add the metadata to the id_token as a custom claim, then it will become available in the user profile, please see

To authenticate in your express rest api please review in the first instance.

Let me know if you need any further info on this.


1 Like

Hi @SaqibHussain,

This information is helpful however how does this look like in the hook?

I want to do a post request so I’m assuming

Something like

var request = require(‘request’);

method: ‘POST’,
url: ‘my_rest_endpoint_url is here’,
headers: {
‘Content-Type’: ‘application/json’,
body: { "firstname": "${user.username}", "username": "${}”}
}, function(error, response, body) {
cb(error, response)

How do I pass the token so that my express api can I identify it?

Please advise


Hey @jerryforcode
I think you have this information now, please let me know if you still need help with it.

1 Like