How to apply a created hook to an application?

I created a Post-Sign Up hook. I also tested it and it works. Now I removed my user and signed up again. Nothing happened.

Do I need to apply the new hook to my application? If yes how and where to do that. I can’t find a word about that in the documentation.

Patrick

Hello, @alemanni.game - welcome to the Auth0 Community!

As long as your Hook is enabled, it will execute after a signup in a database connection.

Bear in mind that Hooks only work for Database connections - not for Social or Enterprise connections.

Let me know if this helps.

1 Like

Hey there!
Thanks for the headsup. That seems to be the issue.
Any way to hook on Social Sign Ups as well? I just want to get notified if a new user is logging into my webapp.

Charlie

@alemanni.game Hey, unfortunately, no. However, you can use a Rule for that purpose, where you can do something along the lines of:

if ( user.logins_count === 1 ) {
    request.post(<code here to post to your external webhook>);
}

Could you give that a try and see if it works?

Sorry I am not so experienced with JS. What kind of library is request.post() from? How can I give it a JSON request body object?

Hello, @alemanni.game,

I am unable to write code for you, but only give you suggestions on how you can potentially achieve different things. I recommend that you use a library that you are familiar with instead :slight_smile: