# Add "username" to the user object

**URL:** <https://community.auth0.com/t/add-username-to-the-user-object/100862>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [February 20, 2023, 3:38pm UTC](https://community.auth0.com/t/add-username-to-the-user-object/100862 "2023-02-20T15:38:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skossan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/skossan/32/44765_2.png) [@skossan](https://community.auth0.com/u/skossan)\
**Post date:** [February 20, 2023, 3:38pm UTC](https://community.auth0.com/t/add-username-to-the-user-object/100862/1 "2023-02-20T15:38:44Z")

</div>

Hello.

Iv’e added the ability for users to pick a username during registrations.

When I call **user** from **useAuth0** I don’t get the username back. Is it possible to add this key value pair to the request?

I’d like to dynamically display which user is logged in.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [February 20, 2023, 10:46pm UTC](https://community.auth0.com/t/add-username-to-the-user-object/100862/3 "2023-02-20T22:46:59Z")

</div>

Hi @skossan,

Welcome to the Auth0 Community!

> [@skossan](#):
>
> When I call **user** from **useAuth0** I don’t get the username back. Is it possible to add this key value pair to the request?

Yes, most definitely. In this scenario, I recommend appending the username as a custom claim to the ID token and calling the [`getIdTokenClaims`](https://auth0.github.io/auth0-react/interfaces/Auth0ContextInterface.html#getIdTokenClaims) property to read these claims on your app.

Please see our [this FAQ](https://community.auth0.com/t/adding-custom-claims-to-tokens/84590) for more instructions on adding custom claims to tokens.

Please let me know if you have any questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![skossan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/skossan/32/44765_2.png) [@skossan](https://community.auth0.com/u/skossan)\
**Post date:** [February 21, 2023, 7:19am UTC](https://community.auth0.com/t/add-username-to-the-user-object/100862/4 "2023-02-21T07:19:04Z")

</div>

Thank you. I will investigate this!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 7, 2023, 7:19am UTC](https://community.auth0.com/t/add-username-to-the-user-object/100862/5 "2023-03-07T07:19:16Z")

</div>

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