{"id":22914438,"url":"https://github.com/ackeecz/bear-auth","last_synced_at":"2025-05-12T13:43:51.217Z","repository":{"id":266310140,"uuid":"897967544","full_name":"AckeeCZ/bear-auth","owner":"AckeeCZ","description":"Bear auth contains a set of methods for managing JWT tokens in single page application.","archived":false,"fork":false,"pushed_at":"2025-04-09T10:41:45.000Z","size":747,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-10T01:06:20.496Z","etag":null,"topics":["authentication","client-authentication","frontend","indexeddb","jwt-authentication","jwt-bearer-tokens","jwt-client","jwt-token","react","single-page-app","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AckeeCZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-12-03T14:56:39.000Z","updated_at":"2025-04-09T10:41:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"e388aa47-af35-4ad4-802a-50937070ea32","html_url":"https://github.com/AckeeCZ/bear-auth","commit_stats":null,"previous_names":["ackeecz/bear-auth"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fbear-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fbear-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fbear-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fbear-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AckeeCZ","download_url":"https://codeload.github.com/AckeeCZ/bear-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253749631,"owners_count":21958157,"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","client-authentication","frontend","indexeddb","jwt-authentication","jwt-bearer-tokens","jwt-client","jwt-token","react","single-page-app","typescript"],"created_at":"2024-12-14T05:14:53.834Z","updated_at":"2025-05-12T13:43:51.200Z","avatar_url":"https://github.com/AckeeCZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐻 Bear Auth\n\nBear auth contains a set of methods for managing JWT tokens in single page applications.\n\n## Features\n\n- 🪶 **Ultra-light**\n    - `@bear-auth/core`: [4.6 kB (min + gzip)](https://bundlephobia.com/package/@bear-auth/core)\n    - `@bear-auth/react`: [0.55 kB (min + gzip)](https://bundlephobia.com/package/@bear-auth/react)\n    - `@bear-auth/storage`: [0.44 kB (min + gzip)](https://bundlephobia.com/package/@bear-auth/storage)\n- ♻️ **Auto access token refreshment**\n    - If the `authenticate` method returns valid `expiration` and `refreshToken`, the `@bear-auth/core` will use the refresh token hook to maintain fresh access token.\n- 🛜 **Network status detection**\n    - To avoid refreshing access token while the app is offline.\n    - By default it uses `navigator.onLine` flag and the `online` event but can be changed via the `setContinueWhenOnline` method.\n- 🏗️ **Highly customizable**\n    - You can override almost all the default behaviour – storage, network, etc.\n- 💨 **Tree-shakeable \u0026 side-effect free**\n    - The API has been designed as pure functions (rather than one heavy object) to support tree-shaking.\n- 🙈 **Framework agnostic**\n    - The `@bear-auth/core` consists of just (promised-based) TypeScript vanilla methods. No attachment to library/framework.\n    - There is currently one official integration for [React](./packages/react) but others can be easily implemented.\n- ✅ **Strongly typed**\n- ✨ **Multiple instances per origin**\n- 👨‍🚒 **Custom error \u0026 guard functions for easier error handling**\n    - `isBearAuthError(error: unknown): error is BearAuthError`\n    - `isBearAuthError(error: unknown, ['bear-auth/retrieve-auth-session-failed']): error is BearAuthError\u003c'bear-auth/retrieve-auth-session-failed'\u003e`\n\n## Packages\n\n- [`@bear-auth/core`](./packages/core)\n- [`@bear-auth/react`](./packages/react)\n- [`@bear-auth/storage`](./packages/storage)\n\n## Examples\n\n- [`@bear-auth/core` example](./examples/core)\n- [`@bear-auth/react` example](./examples/react)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fbear-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fackeecz%2Fbear-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fbear-auth/lists"}