{"id":16206951,"url":"https://github.com/maddygoround/superauth","last_synced_at":"2026-05-05T14:33:28.769Z","repository":{"id":57374683,"uuid":"293208003","full_name":"maddygoround/superauth","owner":"maddygoround","description":"React hooks for firebase authentication","archived":false,"fork":false,"pushed_at":"2020-09-11T12:53:46.000Z","size":284,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T16:51:49.493Z","etag":null,"topics":["firebase","firebase-auth","firebase-authentication","react","react-firebase","react-hooks","reactjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maddygoround.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}},"created_at":"2020-09-06T05:11:23.000Z","updated_at":"2020-09-11T12:53:49.000Z","dependencies_parsed_at":"2022-08-27T11:03:15.750Z","dependency_job_id":null,"html_url":"https://github.com/maddygoround/superauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maddygoround/superauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maddygoround%2Fsuperauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maddygoround%2Fsuperauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maddygoround%2Fsuperauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maddygoround%2Fsuperauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maddygoround","download_url":"https://codeload.github.com/maddygoround/superauth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maddygoround%2Fsuperauth/sbom","scorecard":{"id":610111,"data":{"date":"2025-08-11","repo":{"name":"github.com/maddygoround/superauth","commit":"b121edc79ecd93bb2ff36ae2db0ddb7ef464f5f6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","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":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"Vulnerabilities","score":0,"reason":"72 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-fpm5-vv97-jfwg","Warn: Project is vulnerable to: GHSA-pp75-xfpw-37g9","Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-3wf4-68gx-mph8","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-g954-5hwp-pp24","Warn: Project is vulnerable to: GHSA-h755-8qp9-cq85","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"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-21T02:26:12.751Z","repository_id":57374683,"created_at":"2025-08-21T02:26:12.751Z","updated_at":"2025-08-21T02:26:12.751Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32653570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["firebase","firebase-auth","firebase-authentication","react","react-firebase","react-hooks","reactjs"],"created_at":"2024-10-10T10:09:22.366Z","updated_at":"2026-05-05T14:33:28.751Z","avatar_url":"https://github.com/maddygoround.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# superauth\nReact hooks for firebase authentication\n\n\n[![npm version](https://badge.fury.io/js/superauth.svg)](https://badge.fury.io/js/superauth)\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)\n\n## Installation\n\n```bash\n$ npm i superauth\n```\n\nor\n\n```bash\n$ yarn add superauth\n```\n\n## Usage\n\nThe package expose two custom providers\n`\u003cFirebaseAppProvider\u003e` and `\u003cFirebaseAuthProvider\u003e` as shown here.\n\n```jsx\nimport React from 'react';\nimport { FirebaseAppProvider , FirebaseAuthProvider } from 'superauth';\n\nimport App from './App';\nimport config from './firebaseConfig';\n\nconst MyApp = () =\u003e (\n  \u003cFirebaseAppProvider config={config}\u003e\n    \u003cFirebaseAuthProvider\u003e\n      \u003cApp /\u003e\n    \u003c/FirebaseAuthProvider\u003e\n  \u003c/FirebaseAppProvider\u003e\n);\n\nexport default MyApp;\n```\n\nThis provides the global context that `useAuth` needs. You can use `useAuth`\nanywhere in your App.\n\nInitially, you will probably want to display either a Sign In screen if not signed in.\nYou can detect if you are signed in like this.\n\n```jsx\nimport { useAuth } from 'superauth';\n\nconst App = () =\u003e {\n\n  const { isSignedIn } = useAuth();\n\nuseEffect(() =\u003e {\n    if (isSignedIn) {\n      (async () =\u003e {\n        try {\n        /** do your operation **/\n        } catch (err) {\n          /** throw an exepction **/\n        }\n      })();\n    }\n  }, [isSignedIn])\n\n\n  return (\n    \u003cdiv className=\"App\"\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default App;\n```\n\n```jsx\nimport { useAuth } from 'superauth';\n\nconst App = () =\u003e {\n\n  const { isSignedIn } = useAuth();\n\n  return (\n    \u003cdiv className=\"App\"\u003e\n      {isSignedIn ? \u003cProfile /\u003e : \u003cLogin /\u003e}\n    \u003c/div\u003e\n  );\n};\n\nexport default App;\n```\n\nWe can watch for the change on useEffect or We can either render the `Profile` or the `Login` component.\n.\n\nHere's how you can sign in page with user's Google credentials.\n\n```jsx\nimport { useAuth, AuthProvider } from 'superauth';\n\nconst Login = () =\u003e {\n\nconst { isSignedIn , signIn , createAuthProvider } = useAuth();\n\nuseEffect(() =\u003e {\n    if (isSignedIn) {\n      (async () =\u003e {\n        try {\n            /** signedIn successfully **/\n        } catch (err) {\n            /** signin Error **/\n        }\n      })();\n    }\n  }, [isSignedIn])\n\n  const onSignIn = authProvider =\u003e {\n    const provider = createAuthProvider(authProvider);\n    signIn(provider);\n  };\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003ePlease Sign In\u003c/h1\u003e\n      \u003cp\u003e\n\n        \u003cbutton className=\"btn google-button\" onClick={() =\u003e onSignIn(AuthProvider.GOOGLE)}\u003e\n          Sign In with Google\n        \u003c/button\u003e\n\n        \u003cbutton className=\"btn github-button\" onClick={() =\u003e onSignIn(AuthProvider.GITHUB)}\u003e\n          Sign In with GitHub\n        \u003c/button\u003e\n\n      \u003c/p\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\nCalling onSignIn will redirects you to the authentication page of specficped providers.\n\nAfter the user is authenticated, you will be redirected back to your app where\n`isSignedIn` will be `true`.\n\nYou can rather use a popup, instead of a redirect. To do so first import `AuthMethod` \n\n```js\nimport { AuthMethod} from \"superauth\";\n```\n\nand then change onSignIn` with this.\n\n```js\nconst onSignIn = authProvider =\u003e {\n  const provider = createAuthProvider(authProvider);\n  signIn(provider, AuthType.WITHPOPUP );\n};\n```\n\nYou will note that it destructures two things from the call to `useFirebaseAuth`:\n`user` (a user object) and `signOut` (a function to sign out).\n\n## API\n\nAn import from `superauth` provides\n`FirebaseAuthProvider`, `FirebaseAppProvider` , `useAuth`, `AuthMethod` and `AuthProvider`.\n\n### FirebaseAppProvider\nWrap the `FirebaseAuthProvider` inside `FirebaseAppProvider`\n```jsx\n\u003cFirebaseAppProvider config={config}\u003e\n    \u003cFirebaseAuthProvider\u003e\n        \u003cApp /\u003e\n    \u003c/FirebaseAuthProvider\u003e\n\u003c/FirebaseAppProvider\u003e\n```\n`FirebaseAppProvider` accepts firebaseConfig in `config` properties\n\n### FirebaseAuthProvider\n\nYou must wrap your `App` in `### FirebaseAuthProvider` and `### FirebaseAuthProvider` like this.\n\n```jsx\n\u003cFirebaseAuthProvider\u003e\n  \u003cApp /\u003e\n\u003c/FirebaseAuthProvider\u003e\n```\n\nIt provides context for `useAuth`.\n\n### useAuth\n\n`useAuth` is a custom hook that returns a session object every time that the authentication\nstate changes.\n\nA session object has the following properties.\n\n| Parameter            | Description                                                                  |\n| :------------------- | :--------------------------------------------------------------------------- |\n| `loading`            | Set to `true` if the rest of the session properties are indeterminate.       |\n| `isSignedIn`         | Set to `true` if the user is signed in.                                      |\n| `user`               | A `user` object if signed in, otherwise an empty object. See below.                                                    |\n| `signInError`        | The error from the previous `signIn` attempt or `null` if it was a success.  |\n| `createAuthProvider` | A function that returns a `provider` instance given an enum `AuthProvider` value. |\n| `signIn`             | A function that will take the user on the sign in journey. If successful, `isSignedIn` will be to `false`. See below for details.        |\n| `signOut`            | A function that will sign the user out. If successful, `isSignedIn` will be to `false`.      |\n                                        |\n\n#### signIn\n\nCall `signIn` with an `provider` instance and an optional `options` object.\n\nThe `options` object has a single key of `method`. `method` is a string with either\n`signInWithRedirect` or `signInWithPopup`. The default is `signInWithRedirect`.\n\n`signIn` returns a promise that will resolve upon a successful sign in (if using a popup)\nor reject if a sign in could not be performed.\n\n\n#### signOut\n\nCall `signOut` to sign the user out.\n\nIt returns a promise that will resolve upon a successful sign out\nor reject if a sign out could not be performed.\n\n### AuthProvider\n\n`AuthProvider` is an enum with the following values.\n\n| Parameter   | Description                   |\n| :---------- | :---------------------------- |\n| `ANONYMOUS` | No credentials required.      |\n| `GITHUB`    | Authenticate against GitHub   |\n| `GOOGLE`    | Authenticate against Google.  |\n| `FACEBOOK`  | Authenticate against Facebook |\n| `TWITTER`   | Authenticate against Twitter  |\n\n## License\n\n**[APACHE](LICENSE)** Licensed","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaddygoround%2Fsuperauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaddygoround%2Fsuperauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaddygoround%2Fsuperauth/lists"}