# How to get user id?

**URL:** <https://community.auth0.com/t/how-to-get-user-id/61294>\
**Category:** Get Help\
**Created:** [April 18, 2021, 1:32am UTC](https://community.auth0.com/t/how-to-get-user-id/61294 "2021-04-18T01:32:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eldan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eldan/32/14596_2.png) [@eldan](https://community.auth0.com/u/eldan)\
**Post date:** [April 18, 2021, 1:32am UTC](https://community.auth0.com/t/how-to-get-user-id/61294/1 "2021-04-18T01:32:19Z")

</div>

Hi,

I am trying to get the user id once the user signs up. However when i use the useAuth0() hook. I only get the users object that only has a “sub” field. But it doesn’t contain the user id. I was wondering how I can explicitly get the user id. Thanks!

---

<div class="post-metadata">

**Author:** ![ronifintech](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ronifintech/32/12835_2.png) [@ronifintech](https://community.auth0.com/u/ronifintech)\
**Post date:** [April 18, 2021, 4:45am UTC](https://community.auth0.com/t/how-to-get-user-id/61294/2 "2021-04-18T04:45:30Z")

</div>

According to the link below, it is the `sub` field.  
[Link](https://community.auth0.com/t/how-to-get-user-id-of-a-user-after-login-in-react-hook-useauth0/53309)  
Did you create a different field as the user’s id?

---

<div class="post-metadata">

**Author:** ![eldan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eldan/32/14596_2.png) [@eldan](https://community.auth0.com/u/eldan)\
**Post date:** [April 18, 2021, 5:53am UTC](https://community.auth0.com/t/how-to-get-user-id/61294/3 "2021-04-18T05:53:54Z")

</div>

Thanks for the reply. No i haven’t. I will try to use it see if that will work. Thanks alot!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 19, 2021, 12:33pm UTC](https://community.auth0.com/t/how-to-get-user-id/61294/4 "2021-04-19T12:33:42Z")

</div>

Perfect! Let us know if you have any other questions!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 29, 2021, 12:44pm UTC](https://community.auth0.com/t/how-to-get-user-id/61294/5 "2021-04-29T12:44:24Z")

</div>


