{"id":13880789,"url":"https://github.com/auth0/auth0-react","last_synced_at":"2025-10-03T19:58:26.378Z","repository":{"id":37390775,"uuid":"258221136","full_name":"auth0/auth0-react","owner":"auth0","description":"Auth0 SDK for React Single Page Applications (SPA)","archived":false,"fork":false,"pushed_at":"2025-09-29T22:05:03.000Z","size":4691,"stargazers_count":971,"open_issues_count":22,"forks_count":282,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-10-01T07:51:25.108Z","etag":null,"topics":["authentication","dx-sdk","react","reactjs","spa"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"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/auth0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-23T13:50:59.000Z","updated_at":"2025-10-01T07:24:50.000Z","dependencies_parsed_at":"2023-12-11T17:30:35.864Z","dependency_job_id":"75f2040b-4081-4d8d-b25d-699f3af3f94c","html_url":"https://github.com/auth0/auth0-react","commit_stats":{"total_commits":457,"total_committers":44,"mean_commits":"10.386363636363637","dds":0.7045951859956237,"last_synced_commit":"6429fdd31959548906a2ee1ecc8ec4d3a137ebc3"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/auth0/auth0-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/auth0-react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fauth0-react/sbom","scorecard":{"id":216950,"data":{"date":"2025-08-11","repo":{"name":"github.com/auth0/auth0-react","commit":"9bdfd2552c29a63ebaa4b08352721d47a40429cf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.1,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":7,"reason":"9 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/browserstack.yml:15","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:18","Warn: topLevel 'security-events' permission set to 'write': .github/workflows/codeql.yml:19","Info: topLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:17","Info: topLevel 'contents' permission set to 'read': .github/workflows/integration.yml:15","Warn: no topLevel permission defined: .github/workflows/npm-release.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:9","Warn: no topLevel permission defined: .github/workflows/rl-secure.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/semgrep.yml:17","Info: topLevel 'contents' permission set to 'read': .github/workflows/snyk.yml:18","Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:14","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/browserstack.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/browserstack.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/browserstack.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/browserstack.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/integration.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/integration.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-release.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/npm-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rl-secure.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/rl-secure.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/semgrep.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/semgrep.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/snyk.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/snyk.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/auth0/auth0-react/test.yml/main?enable=pin","Info:   0 out of  14 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.3.0 not signed: https://api.github.com/repos/auth0/auth0-react/releases/196374858","Warn: release artifact v2.3.0 does not have provenance: https://api.github.com/repos/auth0/auth0-react/releases/196374858"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/auth0/.github/.github/SECURITY.md:1","Info: Found linked content: github.com/auth0/.github/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/auth0/.github/.github/SECURITY.md:1","Info: Found text in security policy: github.com/auth0/.github/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during GetBranch(beta): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":10,"reason":"SAST tool detected","details":["Info: SAST configuration detected: CodeQL","Info: SAST configuration detected: Snyk","Warn: 29 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-jgmv-j7ww-jx2x"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T01:49:38.003Z","repository_id":37390775,"created_at":"2025-08-17T01:49:38.003Z","updated_at":"2025-08-17T01:49:38.003Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277867005,"owners_count":25891341,"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","status":"online","status_checked_at":"2025-10-01T02:00:09.286Z","response_time":88,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","dx-sdk","react","reactjs","spa"],"created_at":"2024-08-06T08:03:29.067Z","updated_at":"2025-10-03T19:58:26.344Z","avatar_url":"https://github.com/auth0.png","language":"TypeScript","readme":"![Auth0 SDK for React Single Page Applications](https://cdn.auth0.com/website/sdks/banners/auth0-react-banner.png)\n\n[![npm](https://img.shields.io/npm/v/@auth0/auth0-react.svg?style=flat)](https://www.npmjs.com/package/@auth0/auth0-react)\n[![codecov](https://img.shields.io/codecov/c/github/auth0/auth0-react/main.svg?style=flat)](https://codecov.io/gh/auth0/auth0-react)\n![Downloads](https://img.shields.io/npm/dw/@auth0/auth0-react)\n[![License](https://img.shields.io/:license-mit-blue.svg?style=flat)](https://opensource.org/licenses/MIT)\n[![CircleCI](https://img.shields.io/circleci/build/github/auth0/auth0-react.svg?branch=main\u0026style=flat)](https://circleci.com/gh/auth0/auth0-react)\n\n📚 [Documentation](#documentation) - 🚀 [Getting Started](#getting-started) - 💻 [API Reference](#api-reference) - 💬 [Feedback](#feedback)\n\n## Documentation\n\n- [Quickstart](https://auth0.com/docs/quickstart/spa/react) - our interactive guide for quickly adding login, logout and user information to a React app using Auth0.\n- [Sample App](https://github.com/auth0-samples/auth0-react-samples/tree/master/Sample-01) - a full-fledged React application integrated with Auth0.\n- [FAQs](https://github.com/auth0/auth0-react/blob/main/FAQ.md) - frequently asked questions about the auth0-react SDK.\n- [Examples](https://github.com/auth0/auth0-react/blob/main/EXAMPLES.md) - code samples for common React authentication scenario's.\n- [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0.\n\n## Getting started\n\n### Installation\n\nUsing [npm](https://npmjs.org/)\n\n```bash\nnpm install @auth0/auth0-react\n```\n\nUsing [yarn](https://yarnpkg.com/)\n\n```bash\nyarn add @auth0/auth0-react\n```\n\n### Configure Auth0\n\nCreate a **Single Page Application** in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).\n\n\u003e **If you're using an existing application**, verify that you have configured the following settings in your Single Page Application:\n\u003e\n\u003e - Click on the \"Settings\" tab of your application's page.\n\u003e - Scroll down and click on the \"Show Advanced Settings\" link.\n\u003e - Under \"Advanced Settings\", click on the \"OAuth\" tab.\n\u003e - Ensure that \"JsonWebToken Signature Algorithm\" is set to `RS256` and that \"OIDC Conformant\" is enabled.\n\nNext, configure the following URLs for your application under the \"Application URIs\" section of the \"Settings\" page:\n\n- **Allowed Callback URLs**: `http://localhost:3000`\n- **Allowed Logout URLs**: `http://localhost:3000`\n- **Allowed Web Origins**: `http://localhost:3000`\n\n\u003e These URLs should reflect the origins that your application is running on. **Allowed Callback URLs** may also include a path, depending on where you're handling the callback.\n\nTake note of the **Client ID** and **Domain** values under the \"Basic Information\" section. You'll need these values in the next step.\n\n### Configure the SDK\n\nConfigure the SDK by wrapping your application in `Auth0Provider`:\n\n```jsx\n// src/index.js\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Auth0Provider } from '@auth0/auth0-react';\nimport App from './App';\n\nconst root = createRoot(document.getElementById('app'));\n\nroot.render(\n  \u003cAuth0Provider\n    domain=\"YOUR_AUTH0_DOMAIN\"\n    clientId=\"YOUR_AUTH0_CLIENT_ID\"\n    authorizationParams={{\n      redirect_uri: window.location.origin,\n    }}\n  \u003e\n    \u003cApp /\u003e\n  \u003c/Auth0Provider\u003e\n);\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eInstructions for React \u003c18\u003c/summary\u003e\n\u003cbr\u003e\n\n```jsx\n// src/index.js\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Auth0Provider } from '@auth0/auth0-react';\nimport App from './App';\n\nReactDOM.render(\n  \u003cAuth0Provider\n    domain=\"YOUR_AUTH0_DOMAIN\"\n    clientId=\"YOUR_AUTH0_CLIENT_ID\"\n    authorizationParams={{\n      redirect_uri: window.location.origin,\n    }}\n  \u003e\n    \u003cApp /\u003e\n  \u003c/Auth0Provider\u003e,\n  document.getElementById('app')\n);\n```\n\u003c/details\u003e\n\nUse the `useAuth0` hook in your components to access authentication state (`isLoading`, `isAuthenticated` and `user`) and authentication methods (`loginWithRedirect` and `logout`):\n\n```jsx\n// src/App.js\nimport React from 'react';\nimport { useAuth0 } from '@auth0/auth0-react';\n\nfunction App() {\n  const { isLoading, isAuthenticated, error, user, loginWithRedirect, logout } =\n    useAuth0();\n\n  if (isLoading) {\n    return \u003cdiv\u003eLoading...\u003c/div\u003e;\n  }\n  if (error) {\n    return \u003cdiv\u003eOops... {error.message}\u003c/div\u003e;\n  }\n\n  if (isAuthenticated) {\n    return (\n      \u003cdiv\u003e\n        Hello {user.name}{' '}\n        \u003cbutton onClick={() =\u003e logout({ logoutParams: { returnTo: window.location.origin } })}\u003e\n          Log out\n        \u003c/button\u003e\n      \u003c/div\u003e\n    );\n  } else {\n    return \u003cbutton onClick={() =\u003e loginWithRedirect()}\u003eLog in\u003c/button\u003e;\n  }\n}\n\nexport default App;\n```\n\nFor more code samples on how to integrate **auth0-react** SDK in your **React** application, have a look at our [examples](https://github.com/auth0/auth0-react/blob/main/EXAMPLES.md).\n\n## API reference\n\nExplore public API's available in auth0-react.\n\n- [Auth0Provider](https://auth0.github.io/auth0-react/functions/Auth0Provider.html)\n- [Auth0ProviderOptions](https://auth0.github.io/auth0-react/interfaces/Auth0ProviderOptions.html)\n- [useAuth0](https://auth0.github.io/auth0-react/functions/useAuth0.html)\n- [withAuth0](https://auth0.github.io/auth0-react/functions/withAuth0.html)\n- [withAuthenticationRequired](https://auth0.github.io/auth0-react/functions/withAuthenticationRequired.html)\n\n## Feedback\n\n### Contributing\n\nWe appreciate feedback and contribution to this repo! Before you get started, please see the following:\n\n- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)\n- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)\n- [This repo's contribution guide](https://github.com/auth0/auth0-react/blob/main/CONTRIBUTING.md)\n\n### Raise an issue\n\nTo provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/auth0-react/issues).\n\n### Vulnerability Reporting\n\nPlease do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\"   width=\"150\"\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png\" width=\"150\"\u003e\n    \u003cimg alt=\"Auth0 Logo\" src=\"https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png\" width=\"150\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eAuth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout \u003ca href=\"https://auth0.com/why-auth0\"\u003eWhy Auth0?\u003c/a\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\nThis project is licensed under the MIT license. See the \u003ca href=\"https://github.com/auth0/auth0-react/blob/main/LICENSE\"\u003e LICENSE\u003c/a\u003e file for more info.\u003c/p\u003e\n","funding_links":[],"categories":["TypeScript","Back-End Development"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fauth0-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fauth0-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fauth0-react/lists"}