# Social user signup post registration webhook

**URL:** <https://community.auth0.com/t/social-user-signup-post-registration-webhook/84323>\
**Category:** Get Help\
**Created:** [May 31, 2022, 1:15pm UTC](https://community.auth0.com/t/social-user-signup-post-registration-webhook/84323 "2022-05-31T13:15:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asterbenc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/asterbenc/32/37740_2.png) [@asterbenc](https://community.auth0.com/u/asterbenc)\
**Post date:** [May 31, 2022, 1:15pm UTC](https://community.auth0.com/t/social-user-signup-post-registration-webhook/84323/1 "2022-05-31T13:15:26Z")

</div>

Hi Guys,

I’m trying to set up an action that would trigger my webhook after a user has successfully signed up through social signup (Google & Facebook).

I followed this tutorial step by step: [Integrating Webhooks with Auth0 Using Actions - YouTube](https://www.youtube.com/watch?v=M4I0eVm8S-4)

It seems like the code is actually working, since I successfully triggered the webhook while manually running an action, but the problem is that the action doesn’t get triggered at all, because I’m using the social signup.

What would I have to do in order to trigger the webhook after a user has signed up via Google or Facebook signup feature?

Thanks,  
Anže

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 1, 2022, 12:50am UTC](https://community.auth0.com/t/social-user-signup-post-registration-webhook/84323/4 "2022-06-01T00:50:35Z")

</div>

Hello @asterbenc welcome to the community!

> [@asterbenc](#):
>
> What would I have to do in order to trigger the webhook after a user has signed up via Google or Facebook signup feature?

Unfortunately, this is is a limitation as the [Post User Registration Action](https://auth0.com/docs/customize/actions/flows-and-triggers/post-user-registration-flow?#post-user-registration) is only triggered for database and passwordless connections.

You could look into using a Post Login Action action instead - Something like this comes to mind:

```auto
exports.onExecutePostLogin = async (event, api) => {
if (event.stats.logins_count == 1 && event.connection.strategy == "twitter" || "google-oauth2" || "other_social_connection_name") {
  //do something considering this is a social connection user and the first time logged in (created).
  }
}

```

Basically, you could rely on an initial login from a social user which in this context equates to a user created. I can imagine several ways this might work, all using a [Post Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow) and the `event` and/or `api` object(s) found here:

> **[Actions Triggers: post-login - Event Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object)**
>
> Learn about the post-login Action trigger's event object, which provides contextual information about a single user logging in via Auth0.

> **[Actions Triggers: post-login - API Object](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/api-object)**
>
> Learn about the post-login Action trigger's API object.

I have not tested this myself, but just an idea - Hope this helps!

---

<div class="post-metadata">

**Author:** ![gparascandolo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gparascandolo/32/38788_2.png) [@gparascandolo](https://community.auth0.com/u/gparascandolo)\
**Post date:** [June 1, 2022, 5:49pm UTC](https://community.auth0.com/t/social-user-signup-post-registration-webhook/84323/5 "2022-06-01T17:49:59Z")

</div>

+1 to @ty.frith solution above, but if you need to do a task for initial signups only, you must also include checks in the Auth0 Action against silent authentication/refresh token rotations/etc requests – The Post Login Action is triggered for these events as well and the `logins_count` will remain as `1` for the user.

You can check the type of event that is occurring by looking at the `event.transaction` protocol value.

A better method would be to set a flag in the user’s `app_metadata` object to check against so you know you’ve already done what you needed to do, and skip the task for the user

For example, in addition to what was provided above…

```auto
exports.onExecutePostLogin = async (event, api) => {
    event.user.app_metadata = event.user.app_metadata || {};
    if (event.user.app_metadata.YOUR_FLAG_HERE) return; # skip Action for this user

    // Do your initial social signup stuff here
    api.user.setAppMetadata('YOUR_FLAG_HERE', true);
}

```

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 1, 2022, 6:13pm UTC](https://community.auth0.com/t/social-user-signup-post-registration-webhook/84323/6 "2022-06-01T18:13:18Z")

</div>

Thanks for contributing @gparascandolo - Love it! 😄

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 16, 2022, 6:13pm UTC](https://community.auth0.com/t/social-user-signup-post-registration-webhook/84323/7 "2022-06-16T18:13:53Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
