# Extending properties on nextjs useUser

**URL:** <https://community.auth0.com/t/extending-properties-on-nextjs-useuser/61487>\
**Category:** Get Help\
**Tags:** user-profile, nextjs\
**Created:** [April 21, 2021, 12:19pm UTC](https://community.auth0.com/t/extending-properties-on-nextjs-useuser/61487 "2021-04-21T12:19:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![digvalley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/digvalley/32/28931_2.png) [@digvalley](https://community.auth0.com/u/digvalley)\
**Post date:** [April 21, 2021, 12:19pm UTC](https://community.auth0.com/t/extending-properties-on-nextjs-useuser/61487/1 "2021-04-21T12:19:31Z")

</div>

Which SDK this is regarding: api/auth/me route / userProfile  
SDK Version: 1.3.0  
Platform Version: Vercel

Hi. I’m new to the auth0-nexjs. I am trying to add more properties to the useUser object  
(fetches userinfo from /api/auth/me)

struggling to add properties like app\_metadata.[some-prop].  
I would like to use the useUser hook on components to render different viewa depending on a custom prop.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 21, 2021, 7:23pm UTC](https://community.auth0.com/t/extending-properties-on-nextjs-useuser/61487/3 "2021-04-21T19:23:20Z")

</div>

Hi @digvalley,

Welcome to the Community!

The `/api/auth/me` endpoint provides info from the ID Token payload. To add additional data, you can add custom claims to the ID Token from within a rule:

```auto
function (user, context, callback) {
  const namespace = 'https://my-app.example.com/';
  context.idToken[namespace + 'app_metadata'] = user.app_metadata || 'no app metadata';
  callback(null, user, context);
}

```

> **[Sample Use Cases: Scopes and Claims](https://auth0.com/docs/get-started/apis/scopes/sample-use-cases-scopes-and-claims)**
>
> Learn how to use scopes and claims with applications and APIs.

---

<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:** [May 6, 2021, 7:23pm UTC](https://community.auth0.com/t/extending-properties-on-nextjs-useuser/61487/4 "2021-05-06T19:23:23Z")

</div>

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