{"library":"react-token-auth","type":"library","category":null,"description":"The `react-token-auth` library, currently at version 2.3.8, offers a specialized solution for managing JWT `accessToken` and `refreshToken` pairs within React applications. Its primary function is to abstract the complexities of token storage (e.g., `localStorage` for web or custom async storage for React Native), synchronize the application's authentication state, and automatically handle token expiration and refreshing. A key feature is its `onUpdateToken` callback, which allows developers to integrate with their backend's token refresh endpoint, and its mechanism to prevent concurrent token update requests. While the author acknowledges that cookie-based sessions are generally preferred for web security, `react-token-auth` addresses specific use cases where client-side JWT storage is a requirement. The library provides a concise API including `createAuthProvider` to configure the system, `useAuth` to access the authentication state in components, and `authFetch` to automatically attach tokens to requests. The project appears actively maintained with regular updates and ships with TypeScript type definitions, making it suitable for modern React development practices.","language":"javascript","status":"active","version":"2.3.8","tags":["javascript","typescript"],"install":[{"cmd":"npm install react-token-auth","imports":["import { createAuthProvider } from 'react-token-auth';","import { useAuth } from 'react-token-auth';","import { login } from 'react-token-auth';"]},{"cmd":"yarn add react-token-auth","imports":[]},{"cmd":"pnpm add react-token-auth","imports":[]}],"homepage":null,"github":"https://github.com/obabichev/react-token-auth","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/react-token-auth","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/react-token-auth/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Tue Jul 21","install_tag":null}}