{"id":18896488,"url":"https://github.com/descope/react-sdk","last_synced_at":"2025-05-08T18:31:28.201Z","repository":{"id":65835562,"uuid":"501649991","full_name":"descope/react-sdk","owner":"descope","description":"React library used to integrate with Descope (Deprecated)","archived":true,"fork":false,"pushed_at":"2024-07-11T07:12:44.000Z","size":4612,"stargazers_count":49,"open_issues_count":0,"forks_count":8,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-08T05:06:06.242Z","etag":null,"topics":["authentication","deprecated-repo","descope","jwt","react","react-sdk","reactjs","sdk"],"latest_commit_sha":null,"homepage":"https://github.com/descope/descope-js/tree/main/packages/sdks/react-sdk","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/descope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-09T12:47:39.000Z","updated_at":"2025-05-06T12:54:55.000Z","dependencies_parsed_at":"2023-10-30T18:25:44.848Z","dependency_job_id":"e1652738-fca5-4ff6-9e2b-ed8a0358d168","html_url":"https://github.com/descope/react-sdk","commit_stats":{"total_commits":265,"total_committers":12,"mean_commits":"22.083333333333332","dds":0.6339622641509435,"last_synced_commit":"0c1cf6381c2a8204902597d52661c731b549d238"},"previous_names":[],"tags_count":141,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/descope%2Freact-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/descope%2Freact-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/descope%2Freact-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/descope%2Freact-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/descope","download_url":"https://codeload.github.com/descope/react-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253127048,"owners_count":21858181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","deprecated-repo","descope","jwt","react","react-sdk","reactjs","sdk"],"created_at":"2024-11-08T08:34:10.106Z","updated_at":"2025-05-08T18:31:27.523Z","avatar_url":"https://github.com/descope.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IMPORTANT NOTE: This repository is _DEPRECATED_.\n\nDescope React SDK has been moved to the [descope-js](https://github.com/descope/descope-js/tree/main/packages/sdks/react-sdk) repoistory.\n\n---\n\n# Descope SDK for React\n\nThe Descope SDK for React provides convenient access to the Descope for an application written on top of React. You can read more on the [Descope Website](https://descope.com).\n\n## Requirements\n\n- The SDK supports React version 16 and above.\n- A Descope `Project ID` is required for using the SDK. Find it on the [project page in the Descope Console](https://app.descope.com/settings/project).\n\n## Installing the SDK\n\nInstall the package with:\n\n```bash\nnpm i --save @descope/react-sdk\n```\n\n## Usage\n\n### Wrap your app with Auth Provider\n\n```js\nimport { AuthProvider } from '@descope/react-sdk';\n\nconst AppRoot = () =\u003e {\n\treturn (\n\t\t\u003cAuthProvider\n\t\t\tprojectId=\"my-project-id\"\n\t\t\t// If the Descope project manages the token response in cookies, a custom domain\n\t\t\t// must be configured (e.g., https://auth.app.example.com)\n\t\t\t// and should be set as the baseUrl property.\n\t\t\t// baseUrl = \"https://auth.app.example.com\"\n\t\t\u003e\n\t\t\t\u003cApp /\u003e\n\t\t\u003c/AuthProvider\u003e\n\t);\n};\n```\n\n### Use Descope to render specific flow\n\nYou can use **default flows** or **provide flow id** directly to the Descope component\n\n#### 1. Default flows\n\n```js\nimport { SignInFlow } from '@descope/react-sdk'\n// you can choose flow to run from the following\n// import { SignUpFlow } from '@descope/react-sdk'\n// import { SignUpOrInFlow } from '@descope/react-sdk'\n\nconst App = () =\u003e {\n    return (\n        {...}\n        \u003cSignInFlow\n            onSuccess={(e) =\u003e console.log('Logged in!')}\n            onError={(e) =\u003e console.log('Could not logged in!')}\n        /\u003e\n    )\n}\n```\n\n#### 2. Provide flow id\n\n```js\nimport { Descope } from '@descope/react-sdk'\n\nconst App = () =\u003e {\n    return (\n        {...}\n        \u003cDescope\n            flowId=\"my-flow-id\"\n            onSuccess={(e) =\u003e console.log('Logged in!')}\n            onError={(e) =\u003e console.log('Could not logged in')}\n\t\t\t\t\t\t// onReady={() =\u003e {\n\t\t\t\t\t\t//   This event is triggered when the flow is ready to be displayed\n\t\t\t\t\t\t//   Its useful for showing a loading indication before the page ready\n\t\t\t\t\t\t//   console.log('Flow is ready');\n\t\t\t\t\t\t// }}\n            // theme can be \"light\", \"dark\" or \"os\", which auto select a theme based on the OS theme. Default is \"light\"\n            // theme=\"dark\"\n\n            // locale can be any supported locale which the flow's screen translated to, if not provided, the locale is taken from the browser's locale.\n            // locale=\"en\"\n\n            // debug can be set to true to enable debug mode\n            // debug={true}\n\n            // tenant ID for SSO (SAML) login. If not provided, Descope will use the domain of available email to choose the tenant\n            // tenant=\u003ctenantId\u003e\n\n            // Redirect URL for OAuth and SSO (will be used when redirecting back from the OAuth provider / IdP), or for \"Magic Link\" and \"Enchanted Link\" (will be used as a link in the message sent to the the user)\n            // redirectUrl=\u003credirectUrl\u003e\n\n            // autoFocus can be true, false or \"skipFirstScreen\". Default is true.\n            // - true: automatically focus on the first input of each screen\n            // - false: do not automatically focus on screen's inputs\n            // - \"skipFirstScreen\": automatically focus on the first input of each screen, except first screen\n            // autoFocus=\"skipFirstScreen\"\n\n            // validateOnBlur: set it to true will show input validation errors on blur, in addition to on submit\n\n            // errorTransformer is a function that receives an error object and returns a string. The returned string will be displayed to the user.\n            // NOTE: errorTransformer is not required. If not provided, the error object will be displayed as is.\n            // Example:\n            // const errorTransformer = useCallback(\n            // \t(error: { text: string; type: string }) =\u003e {\n            // \t\tconst translationMap = {\n            // \t\t\tSAMLStartFailed: 'Failed to start SAML flow'\n            // \t\t};\n            // \t\treturn translationMap[error.type] || error.text;\n            // \t},\n            // \t[]\n            // );\n            // ...\n            // errorTransformer={errorTransformer}\n            // ...\n\n\n            // form is an object the initial form context that is used in screens inputs in the flow execution.\n            // Used to inject predefined input values on flow start such as custom inputs, custom attributes and other inputs.\n            // Keys passed can be accessed in flows actions, conditions and screens prefixed with \"form.\".\n            // NOTE: form is not required. If not provided, 'form' context key will be empty before user input.\n            // Example:\n            // ...\n            // form={{ email: \"predefinedname@domain.com\",  firstName: \"test\", \"customAttribute.test\": \"aaaa\", \"myCustomInput\": 12 }}\n            // ...\n\n\n            // client is an object the initial client context in the flow execution.\n            // Keys passed can be accessed in flows actions and conditions prefixed with \"client.\".\n            // NOTE: client is not required. If not provided, context key will be empty.\n            // Example:\n            // ...\n            // client={{ version: \"1.2.0\" }}\n            // ...\n\n\n            // logger is an object describing how to log info, warn and errors.\n            // NOTE: logger is not required. If not provided, the logs will be printed to the console.\n            // Example:\n            // const logger = {\n            // \tinfo: (title: string, description: string, state: any) =\u003e {\n            //      console.log(title, description, JSON.stringify(state));\n            //  },\n            // \twarn: (title: string, description: string) =\u003e {\n            //      console.warn(title);\n            //  },\n            // \terror: (title: string, description: string) =\u003e {\n            //      console.error('OH NOO');\n            //  },\n            // }\n            // ...\n            // logger={logger}\n            // ...\n        /\u003e\n    )\n}\n```\n\n### Use the `useDescope`, `useSession` and `useUser` hooks in your components in order to get authentication state, user details and utilities\n\nThis can be helpful to implement application-specific logic. Examples:\n\n- Render different components if current session is authenticated\n- Render user's content\n- Logout button\n\n```js\nimport { useDescope, useSession, useUser } from '@descope/react-sdk';\nimport { useCallback } from 'react';\n\nconst App = () =\u003e {\n\t// NOTE - `useDescope`, `useSession`, `useUser` should be used inside `AuthProvider` context,\n\t// and will throw an exception if this requirement is not met\n\t// useSession retrieves authentication state, session loading status, and session token\n\tconst { isAuthenticated, isSessionLoading, sessionToken } = useSession();\n\t// useUser retrieves the logged in user information\n\tconst { user, isUserLoading } = useUser();\n\t// useDescope retrieves Descope SDK for further operations related to authentication\n\t// such as logout\n\tconst sdk = useDescope();\n\n\tif (isSessionLoading || isUserLoading) {\n\t\treturn \u003cp\u003eLoading...\u003c/p\u003e;\n\t}\n\n\tconst handleLogout = useCallback(() =\u003e {\n\t\tsdk.logout();\n\t}, [sdk]);\n\n\tif (isAuthenticated) {\n\t\treturn (\n\t\t\t\u003c\u003e\n\t\t\t\t\u003cp\u003eHello {user.name}\u003c/p\u003e\n\t\t\t\t\u003cbutton onClick={handleLogout}\u003eLogout\u003c/button\u003e\n\t\t\t\u003c/\u003e\n\t\t);\n\t}\n\n\treturn \u003cp\u003eYou are not logged in\u003c/p\u003e;\n};\n```\n\nNote: `useSession` triggers a single request to the Descope backend to attempt to refresh the session. If you **don't** `useSession` on your app, the session will not be refreshed automatically. If your app does not require `useSession`, you can trigger the refresh manually by calling `refresh` from `useDescope` hook. Example:\n\n```js\nconst { refresh } = useDescope();\nuseEffect(() =\u003e {\n\trefresh();\n}, [refresh]);\n```\n\n**For more SDK usage examples refer to [docs](https://docs.descope.com/build/guides/client_sdks/)**\n\n### Session token server validation (pass session token to server API)\n\nWhen developing a full-stack application, it is common to have private server API which requires a valid session token:\n\n![session-token-validation-diagram](https://docs.descope.com/static/SessionValidation-cf7b2d5d26594f96421d894273a713d8.png)\n\nNote: Descope also provides server-side SDKs in various languages (NodeJS, Go, Python, etc). Descope's server SDKs have out-of-the-box session validation API that supports the options described bellow. To read more about session validation, Read [this section](https://docs.descope.com/build/guides/gettingstarted/#session-validation) in Descope documentation.\n\nThere are 2 ways to achieve that:\n\n1. Using `getSessionToken` to get the token, and pass it on the `Authorization` Header (Recommended)\n2. Passing `sessionTokenViaCookie` boolean prop to the `AuthProvider` component (Use cautiously, session token may grow, especially in cases of using authorization, or adding custom claim)\n\n#### 1. Using `getSessionToken` to get the token\n\nAn example for api function, and passing the token on the `Authorization` header:\n\n```js\nimport { getSessionToken } from '@descope/react-sdk';\n\n// fetch data using back\n// Note: Descope backend SDKs support extracting session token from the Authorization header\nexport const fetchData = async () =\u003e {\n\tconst sessionToken = getSessionToken();\n\tconst res = await fetch('/path/to/server/api', {\n\t\theaders: {\n\t\t\tAuthorization: `Bearer ${sessionToken}`\n\t\t}\n\t});\n\t// ... use res\n};\n```\n\nAn example for component that uses `fetchData` function from above\n\n```js\n// Component code\nimport { fetchData } from 'path/to/api/file'\nimport { useCallback } from 'react'\n\nconst Component = () =\u003e {\n    const onClick = useCallback(() =\u003e {\n        fetchData()\n    },[])\n    return (\n        {...}\n        {\n            // button that triggers an API that may use session token\n            \u003cbutton onClick={onClick}\u003eClick Me\u003c/button\u003e\n        }\n    )\n}\n```\n\n#### 2. Passing `sessionTokenViaCookie` boolean prop to the `AuthProvider`\n\nPassing `sessionTokenViaCookie` prop to `AuthProvider` component. Descope SDK will automatically store session token on the `DS` cookie.\n\nNote: Use this option if session token will stay small (less than 1k). Session token can grow, especially in cases of using authorization, or adding custom claims\n\nExample:\n\n```js\nimport { AuthProvider } from '@descope/react-sdk';\n\nconst AppRoot = () =\u003e {\n\treturn (\n\t\t\u003cAuthProvider projectId=\"my-project-id\" sessionTokenViaCookie\u003e\n\t\t\t\u003cApp /\u003e\n\t\t\u003c/AuthProvider\u003e\n\t);\n};\n```\n\nNow, whenever you call `fetch`, the cookie will automatically be sent with the request. Descope backend SDKs also support extracting the token from the `DS` cookie.\n\nNote:\nThe session token cookie is set as a [`Secure`](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2.5) cookie. It will be sent only over HTTPS connections.\nIn addition, some browsers (e.g. Safari) may not store `Secure` cookie if the hosted page is running on an HTTP protocol.\n\n### Helper Functions\n\nYou can also use the following functions to assist with various actions managing your JWT.\n\n`getSessionToken()` - Get current session token.\n`getRefreshToken()` - Get current refresh token.\n`refresh(token = getRefreshToken())` - Force a refresh on current session token using an existing valid refresh token.\n`isSessionTokenExpired(token = getSessionToken())` - Check whether the current session token is expired. Provide a session token if is not persisted (see [token persistence](#token-persistence)).\n`isRefreshTokenExpired(token = getRefreshToken())` - Check whether the current refresh token is expired. Provide a refresh token if is not persisted (see [token persistence](#token-persistence)).\n`getJwtRoles(token = getSessionToken(), tenant = '')` - Get current roles from an existing session token. Provide tenant id for specific tenant roles.\n`getJwtPermissions(token = getSessionToken(), tenant = '')` - Fet current permissions from an existing session token. Provide tenant id for specific tenant permissions.\n\n### Refresh token lifecycle\n\nDescope SDK is automatically refreshes the session token when it is about to expire. This is done in the background using the refresh token, without any additional configuration.\n\nIf the Descope project settings are configured to manage tokens in cookies.\nyou must also configure a custom domain, and set it as the `baseUrl` prop in the `AuthProvider` component. See the above [`AuthProvider` usage](https://github.com/descope/react-sdk#wrap-your-app-with-auth-provider) for usage example.\n\n### Token Persistence\n\nDescope stores two tokens: the session token and the refresh token.\n\n- The refresh token is either stored in local storage or an `httpOnly` cookie. This is configurable in the Descope console.\n- The session token is stored in either local storage or a JS cookie. This behavior is configurable via the `sessionTokenViaCookie` prop in the `AuthProvider` component.\n\nHowever, for security reasons, you may choose not to store tokens in the browser. In this case, you can pass `persistTokens={false}` to the `AuthProvider` component. This prevents the SDK from storing the tokens in the browser.\n\nNotes:\n\n- You must configure the refresh token to be stored in an `httpOnly` cookie in the Descope console. Otherwise, the refresh token will not be stored, and when the page is refreshed, the user will be logged out.\n- You can still retrieve the session token using the `useSession` hook.\n\n### Last User Persistence\n\nDescope stores the last user information in local storage. If you wish to disable this feature, you can pass `storeLastAuthenticatedUser={false}` to the `AuthProvider` component. Please note that some features related to the last authenticated user may not function as expected if this behavior is disabled. Local storage is being cleared when the user logs out, if you want the avoid clearing the local storage, you can pass `keepLastAuthenticatedUserAfterLogout={true}` to the `AuthProvider` component.\n\n### Widgets\n\nWidgets are components that allow you to expose management features for tenant-based implementation. In certain scenarios, your customers may require the capability to perform managerial actions independently, alleviating the necessity to contact you. Widgets serve as a feature enabling you to delegate these capabilities to your customers in a modular manner.\n\nImportant Note:\n\n- For the user to be able to use the widget, they need to be assigned the `Tenant Admin` Role.\n\n#### User Management\n\nThe `UserManagement` widget lets you embed a user table in your site to view and take action.\n\nThe widget lets you:\n\n- Create a new user\n- Edit an existing user\n- Activate / disable an existing user\n- Reset an existing user's password\n- Remove an existing user's passkey\n- Delete an existing user\n\nNote:\n\n- Custom fields also appear in the table.\n\n###### Usage\n\n```js\nimport { UserManagement } from '@descope/react-sdk';\n...\n  \u003cUserManagement\n    widgetId=\"user-management-widget\"\n    tenant=\"tenant-id\"\n  /\u003e\n```\n\nExample:\n[Manage Users](./examples/app/ManageUsers.tsx)\n\n#### Role Management\n\nThe `RoleManagement` widget lets you embed a role table in your site to view and take action.\n\nThe widget lets you:\n\n- Create a new role\n- Change an existing role's fields\n- Delete an existing role\n\nNote:\n\n- The `Editable` field is determined by the user's access to the role - meaning that project-level roles are not editable by tenant level users.\n- You need to pre-define the permissions that the user can use, which are not editable in the widget.\n\n###### Usage\n\n```js\nimport { RoleManagement } from '@descope/react-sdk';\n...\n  \u003cRoleManagement\n    widgetId=\"role-management-widget\"\n    tenant=\"tenant-id\"\n  /\u003e\n```\n\nExample:\n[Manage Roles](./examples/app/ManageRoles.tsx)\n\n#### Access Key Management\n\nThe `AccessKeyManagement` widget lets you embed an access key table in your site to view and take action.\n\nThe widget lets you:\n\n- Create a new access key\n- Activate / deactivate an existing access key\n- Delete an exising access key\n\n###### Usage\n\n```js\nimport { AccessKeyManagement } from '@descope/react-sdk';\n...\n  {\n\t  /* admin view: manage all tenant users' access keys */\n  }\n  \u003cAccessKeyManagement\n    widgetId=\"access-key-management-widget\"\n    tenant=\"tenant-id\"\n  /\u003e\n\n  {\n    /* user view: mange access key for the logged-in tenant's user */\n  }\n  \u003cAccessKeyManagement\n    widgetId=\"user-access-key-management-widget\"\n    tenant=\"tenant-id\"\n  /\u003e\n```\n\nExample:\n[Manage Access Keys](./examples/app/ManageAccessKeys.tsx)\n\n#### Audit Management\n\nThe `AuditManagement` widget lets you embed an audit table in your site.\n\n###### Usage\n\n```js\nimport { AuditManagement } from '@descope/react-sdk';\n...\n  \u003cAuditManagement\n    widgetId=\"audit-management-widget\"\n    tenant=\"tenant-id\"\n  /\u003e\n```\n\nExample:\n[Manage Audit](./examples/app/ManageAudit.tsx)\n\n#### User Profile\n\nThe `UserProfile` widget lets you embed a user profile component in your app and let the logged in user update his profile.\n\nThe widget lets you:\n\n- Update user profile picture\n- Update user personal information\n- Update authentication methods\n- Logout\n\n###### Usage\n\n```js\nimport { UserProfile } from '@descope/react-sdk';\n...\n  \u003cUserProfile\n    widgetId=\"user-profile-widget\"\n    onLogout={() =\u003e {\n      // add here you own logout callback\n      window.location.href = '/login';\n    }}\n  /\u003e\n```\n\nExample:\n[User Profile](./examples/app/MyUserProfile.tsx)\n\n## Code Example\n\nYou can find an example react app in the [examples folder](./examples).\n\n### Setup\n\nTo run the examples, set your `Project ID` by setting the `DESCOPE_PROJECT_ID` env var or directly\nin the sample code.\nFind your Project ID in the [Descope console](https://app.descope.com/settings/project).\n\n```bash\nexport DESCOPE_PROJECT_ID=\u003cProject-ID\u003e\n```\n\nAlternatively, put the environment variable in `.env` file in the project root directory.\nSee bellow for an `.env` file template with more information.\n\n### Run Example\n\nRun the following command in the root of the project to build and run the example:\n\n```bash\nnpm i \u0026\u0026 npm start\n```\n\n### Example Optional Env Variables\n\nSee the following table for customization environment variables for the example app:\n\n| Env Variable            | Description                                                                                                   | Default value                    |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------- |\n| DESCOPE_FLOW_ID         | Which flow ID to use in the login page                                                                        | **sign-up-or-in**                |\n| DESCOPE_BASE_URL        | Custom Descope base URL                                                                                       | None                             |\n| DESCOPE_BASE_STATIC_URL | Allows to override the base URL that is used to fetch static files                                            | https://static.descope.com/pages |\n| DESCOPE_THEME           | Flow theme                                                                                                    | None                             |\n| DESCOPE_LOCALE          | Flow locale                                                                                                   | Browser's locale                 |\n| DESCOPE_REDIRECT_URL    | Flow redirect URL for OAuth/SSO/Magic Link/Enchanted Link                                                     | None                             |\n| DESCOPE_TENANT_ID       | Flow tenant ID for SSO/SAML                                                                                   | None                             |\n| DESCOPE_DEBUG_MODE      | **\"true\"** - Enable debugger\u003c/br\u003e**\"false\"** - Disable flow debugger                                          | None                             |\n| DESCOPE_STEP_UP_FLOW_ID | Step up flow ID to show to logged in user (via button). e.g. \"step-up\". Button will be hidden if not provided | None                             |\n| DESCOPE_TELEMETRY_KEY   | **String** - Telemetry public key provided by Descope Inc                                                     | None                             |\n|                         |                                                                                                               |                                  |\n\nExample for `.env` file template:\n\n```\n# Your project ID\nDESCOPE_PROJECT_ID=\"\u003cProject-ID\u003e\"\n# Login flow ID\nDESCOPE_FLOW_ID=\"\"\n# Descope base URL\nDESCOPE_BASE_URL=\"\"\n# Descope base static URL\nDESCOPE_BASE_STATIC_URL=\"\"\n# Set flow theme to dark\nDESCOPE_THEME=dark\n# Set flow locale, default is browser's locale\nDESCOPE_LOCALE=\"\"\n# Flow Redirect URL\nDESCOPE_REDIRECT_URL=\"\"\n# Tenant ID\nDESCOPE_TENANT_ID=\"\"\n# Enable debugger\nDESCOPE_DEBUG_MODE=true\n# Show step-up flow for logged in user\nDESCOPE_STEP_UP_FLOW_ID=step-up\n# Telemetry key\nDESCOPE_TELEMETRY_KEY=\"\"\n```\n\n## FAQ\n\n### I updated the user in my backend, but the user / session token are not updated in the frontend\n\nThe Descope SDK caches the user and session token in the frontend. If you update the user in your backend (using Descope Management SDK/API for example), you can call `me` / `refresh` from `useDescope` hook to refresh the user and session token. Example:\n\n```js\nconst sdk = useDescope();\n\nconst handleUpdateUser = useCallback(() =\u003e {\n\tmyBackendUpdateUser().then(() =\u003e {\n\t\tsdk.me();\n\t\t// or\n\t\tsdk.refresh();\n\t});\n}, [sdk]);\n```\n\n## Learn More\n\nTo learn more please see the [Descope Documentation and API reference page](https://docs.descope.com/).\n\n## Contact Us\n\nIf you need help you can email [Descope Support](mailto:support@descope.com)\n\n## License\n\nThe Descope SDK for React is licensed for use under the terms and conditions of the [MIT license Agreement](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdescope%2Freact-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdescope%2Freact-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdescope%2Freact-sdk/lists"}