# Send Immediate Membership Confirmation After Account Creation

**URL:** <https://forum.social.plus/t/send-immediate-membership-confirmation-after-account-creation/1392>\
**Category:** TS SDK\
**Created:** [July 14, 2024, 4:38am UTC](https://forum.social.plus/t/send-immediate-membership-confirmation-after-account-creation/1392 "2024-07-14T04:38:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cadybo](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@cadybo](https://forum.social.plus/u/cadybo)\
**Post date:** [July 14, 2024, 4:38am UTC](https://forum.social.plus/t/send-immediate-membership-confirmation-after-account-creation/1392/1 "2024-07-14T04:38:48Z")

</div>

Hi everyone,

I’m currently working on a webhook listener that handles events from Amity Social Cloud. Whenever a new user is created (`user.didCreate` event), the user is automatically added to a community. Here’s the code I’m using:

```auto
import axios from 'axios';
import { Request, Response } from 'express';

export const handleAmityEvents = async (req: Request, res: Response) => {
  const event = req.body;
  if (event.event === "user.didCreate") {
    handleAddUserToCommunity(event.data.users[0].userId);
  }
  return res.json(event);
};

const handleAddUserToCommunity = async (userId: string) => {
  const communityId = await getOneApiKeyAdmin({ keyName: "communityId" });

  axios.post(`https://api.sg.amity.co/api/v3/communities/${communityId}/users`, {
    userIds: [userId],
  }, {
    headers: {
      'Authorization': `Bearer ${process.env.AMITY_ADMIN_KEY}`
    }
  }).then((res) => {
    // Handle successful response
  }).catch((err) => {
    // Handle error
  });
};

```

The new users are being added to the community without problems. However, I want to ask for user consent before adding them to the community. Specifically, I want to show them a pop-up to confirm if they want to join the community.  
How can I do that?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [July 15, 2024, 6:52am UTC](https://forum.social.plus/t/send-immediate-membership-confirmation-after-account-creation/1392/2 "2024-07-15T06:52:04Z")

</div>

Hello @cadybo , Thank you for your question. Currently, we do not have a built-in feature to ask for user consent before adding them to a community. You will need to implement this on your side. We will also forward this request to our product team for future consideration and improvements.

---

<div class="post-metadata">

**Author:** ![cadybo](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@cadybo](https://forum.social.plus/u/cadybo)\
**Post date:** [July 15, 2024, 9:53am UTC](https://forum.social.plus/t/send-immediate-membership-confirmation-after-account-creation/1392/3 "2024-07-15T09:53:11Z")

</div>

Hi @SocialPlus_Support ,

Thanks for your response. Do you have any suggestions or best practices on how I can implement this user consent feature on my end?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [July 15, 2024, 11:13am UTC](https://forum.social.plus/t/send-immediate-membership-confirmation-after-account-creation/1392/4 "2024-07-15T11:13:16Z")

</div>

Hello @cadybo, unfortunately, we don’t have a detailed guide available for this scenario. However, since you mentioned a pop-up, it should be handled on both the frontend and backend. You might need to do some additional exploring to get the full picture.

Please let us know if you have any other questions or if there’s anything else we can assist you with.
