# Get Client object or application data when using auth0-react sdk in SPA

**URL:** <https://community.auth0.com/t/get-client-object-or-application-data-when-using-auth0-react-sdk-in-spa/131125>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [April 3, 2024, 4:59pm UTC](https://community.auth0.com/t/get-client-object-or-application-data-when-using-auth0-react-sdk-in-spa/131125 "2024-04-03T16:59:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reshad](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/reshad/32/49410_2.png) [@reshad](https://community.auth0.com/u/reshad)\
**Post date:** [April 3, 2024, 4:59pm UTC](https://community.auth0.com/t/get-client-object-or-application-data-when-using-auth0-react-sdk-in-spa/131125/1 "2024-04-03T16:59:19Z")

</div>

I am using auth0-react sdk to integrate auth0 in my application.

on auth0 platform I have setup some application data in application’s advanced settings

I need to know how can I get those application data key-value pairs using auth0-react

or if there is any other way to get it in my react app

---

<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:** [April 8, 2024, 11:08pm UTC](https://community.auth0.com/t/get-client-object-or-application-data-when-using-auth0-react-sdk-in-spa/131125/3 "2024-04-08T23:08:06Z")

</div>

Hey there @reshad welcome to the community!

> [@reshad](#):
>
> I need to know how can I get those application data key-value pairs using auth0-react

In the context of a user, you can add this metadata as a custom claim in tokens using an Action - Otherwise, you could just use the Management API [/api/v2/clients/{id}](https://auth0.com/docs/api/management/v2/clients/get-clients-by-id) endpoint.

A Post Login Action utilizing `event.client.metadata` might look something like:

```auto
exports.onExecutePostLogin = async (event, api) => {
  // Check if a specific metadata field exists in the client's metadata
  if (event.client.metadata && event.client.metadata.someSpecialFlag === 'true') {
    // Perform a specific action if the flag is set to true
    // For example, adding a custom claim to the ID token
    api.idToken.setCustomClaim("https://example.com/special_user", true);
  }
};

```

---

<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:** [April 22, 2024, 11:09pm UTC](https://community.auth0.com/t/get-client-object-or-application-data-when-using-auth0-react-sdk-in-spa/131125/4 "2024-04-22T23:09:05Z")

</div>

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