{"id":48346494,"url":"https://github.com/abgaryanharutyun/react-auth-verification-context","last_synced_at":"2026-04-05T07:04:30.938Z","repository":{"id":65061248,"uuid":"581470970","full_name":"abgaryanharutyun/react-auth-verification-context","owner":"abgaryanharutyun","description":"react-auth-verification-context is a library that provides a way to manage authentication state in a React application. It is implemented using the React context API, which allows you to pass data through the component tree without having to pass props down manually at every level.","archived":false,"fork":false,"pushed_at":"2022-12-24T21:29:51.000Z","size":397,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T04:21:09.698Z","etag":null,"topics":["authentication","react","react-native","reactjs","state-management"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-auth-verification-context","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abgaryanharutyun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-23T09:29:47.000Z","updated_at":"2024-02-28T11:40:00.000Z","dependencies_parsed_at":"2023-01-12T07:45:51.345Z","dependency_job_id":null,"html_url":"https://github.com/abgaryanharutyun/react-auth-verification-context","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abgaryanharutyun/react-auth-verification-context","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abgaryanharutyun%2Freact-auth-verification-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abgaryanharutyun%2Freact-auth-verification-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abgaryanharutyun%2Freact-auth-verification-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abgaryanharutyun%2Freact-auth-verification-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abgaryanharutyun","download_url":"https://codeload.github.com/abgaryanharutyun/react-auth-verification-context/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abgaryanharutyun%2Freact-auth-verification-context/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31427387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T02:22:46.605Z","status":"ssl_error","status_checked_at":"2026-04-05T02:22:33.263Z","response_time":75,"last_error":"SSL_read: 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":["authentication","react","react-native","reactjs","state-management"],"created_at":"2026-04-05T07:04:27.699Z","updated_at":"2026-04-05T07:04:30.928Z","avatar_url":"https://github.com/abgaryanharutyun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"react-theme-provider\" src=\"./assets/auth-provider-logo-2.jpg\" \u003e\n\u003c/p\u003e\n\n---\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/abgaryanharutyun/react-auth-verification-context/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/abgaryanharutyun/react-auth-verification-context/tree/master)\n\n[![codecov](https://codecov.io/gh/abgaryanharutyun/react-auth-verification-context/branch/master/graph/badge.svg?token=YSQ2HFT892)](https://codecov.io/gh/abgaryanharutyun/react-auth-verification-context)\n\n[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\n\n## About\n\n`react-auth-verification-context` is a library that provides a way to manage authentication state in a React application. It is implemented using the React context API, which allows you to pass data through the component tree without having to pass props down manually at every level.\n\nTo use `react-auth-verification-context`, you will need to wrap your root component with an AuthProvider component, which provides the authentication state and methods for updating it as props to its children. You can then use the useAuth hook to access the authentication state and methods from within any descendant component.\n\n## Features\n\n- Works in **React** and **React Native**\n  - `AuthProvider` - Provider component\n  - `useAuth` - React Hook\n    - `login`\n    - `logout`\n    - `restoreToken`\n    - `isAuthenticated`\n    - `attributes`\n\n## Getting started\n\n### Installation\n\n```sh\nyarn add react-auth-verification-context\n```\n\nor using npm\n\n```sh\nnpm install react-auth-verification-context --save\n```\n\n### Usage\n\n```javascript\nimport { AuthProvider, useAuth } from 'react-auth-verification-context';\n\nfunction App() {\n  return (\n    \u003cAuthProvider\u003e\n      \u003cAppNavigation /\u003e\n    \u003c/AuthProvider\u003e\n  );\n}\n\nfunction AppNavigation() {\n  const { isAuthenticated, login, logout } = useAuth();\n  useEffect(() =\u003e {\n    const bootstrapAsync = async () =\u003e {\n      setLoading(true);\n      let userAttributes = null;\n      try {\n        const user = await checkAuth();\n        const { attributes: userAttr } = user;\n        userAttributes = userAttr;\n      } catch (e) {\n        console.log('error', e);\n      }\n      restoreToken(userAttributes);\n      setLoading(false);\n    };\n\n    bootstrapAsync();\n  }, []);\n\n  return (\n    \u003cdiv\u003e\n      {isAuthenticated ? (\n        \u003cbutton onClick={logout}\u003eLogout\u003c/button\u003e\n      ) : (\n        \u003cbutton onClick={() =\u003e login({ name: 'John Smit', id: '123' })}\u003eLogin\u003c/button\u003e\n      )}\n    \u003c/div\u003e\n  );\n}\n```\n\nIn this example, the `AuthProvider` component provides the `isAuthenticated`, `login`, and `logout` values as context to the `AppNavigation` component, which can then use them to render a login or logout button depending on the authentication state.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabgaryanharutyun%2Freact-auth-verification-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabgaryanharutyun%2Freact-auth-verification-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabgaryanharutyun%2Freact-auth-verification-context/lists"}