{"id":44026769,"url":"https://github.com/kennethnnabuife/auth-flow-kit","last_synced_at":"2026-02-07T18:09:17.142Z","repository":{"id":325166560,"uuid":"1100100595","full_name":"kennethnnabuife/auth-flow-kit","owner":"kennethnnabuife","description":"A global authentication state toolkit for React with prebuilt UI screens and a globally accessible useAuth() hook. No separate stores, persistence layers, or setup files required. Integrates directly at the app layout level, with auth state remaining consistent across refreshes without manual persistence.","archived":false,"fork":false,"pushed_at":"2026-02-03T00:21:58.000Z","size":91,"stargazers_count":54,"open_issues_count":3,"forks_count":21,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-03T13:49:08.698Z","etag":null,"topics":["auth","authentication","developer-tools","fork-for-contribution","frontend-authentication","global-state-management","javascript","javascript-library","npm","npm-package","open-source","open-source-community","open-source-library","open-source-project","open-source-tools","react","react-library","review","typescript","typescript-library"],"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/kennethnnabuife.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-19T20:55:08.000Z","updated_at":"2026-02-03T13:27:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kennethnnabuife/auth-flow-kit","commit_stats":null,"previous_names":["kennethnnabuife/auth-flow-kit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kennethnnabuife/auth-flow-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethnnabuife%2Fauth-flow-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethnnabuife%2Fauth-flow-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethnnabuife%2Fauth-flow-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethnnabuife%2Fauth-flow-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kennethnnabuife","download_url":"https://codeload.github.com/kennethnnabuife/auth-flow-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennethnnabuife%2Fauth-flow-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29203254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["auth","authentication","developer-tools","fork-for-contribution","frontend-authentication","global-state-management","javascript","javascript-library","npm","npm-package","open-source","open-source-community","open-source-library","open-source-project","open-source-tools","react","react-library","review","typescript","typescript-library"],"created_at":"2026-02-07T18:09:15.676Z","updated_at":"2026-02-07T18:09:17.137Z","avatar_url":"https://github.com/kennethnnabuife.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @kendevelops/auth-flow-kit\n\nA beginner‑friendly authentication toolkit for **React** and **Next.js 13–16 (App Router)**.\n\nThis is literally the **simplest and shortest setup** for your Next.js apps.\nYou do **not** need extra wrapper files.\n\n---\n\nIt gives you:\n\n- Global auth state (Redux / Zustand‑style, but zero setup)\n- Prebuilt auth UI screens (Login, Signup, Reset)\n- A simple `useAuth()` hook you can use anywhere\n\nThis library is intentionally designed to be **easy to understand**, even if you are new to authentication.\n\n---\n\n## 🔄 No Persistence Setup Needed\n\nauth-flow-kit keeps authentication state in memory by default, and automatically restores the session when the app reloads.\n\n**What this means in practice:**\n\nFrom a developer’s point of view:\n\n\u003e “I refresh the page and I’m still logged in.”\n\nThat’s it.\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install @kendevelops/auth-flow-kit\n```\n\n```bash\nyarn add @kendevelops/auth-flow-kit\n```\n\n```bash\nbun add @kendevelops/auth-flow-kit\n```\n\n---\n\n# 🚀 Usage with Next.js App Router (Recommended)\n\n---\n\n## Step 1: Wrap your app in `app/layout.tsx`\n\n\u003e Yes, `layout.tsx` can be a client component when it hosts providers. This is normal.\n\n```tsx\n// app/layout.tsx\n\"use client\";\n\nimport { AuthProvider } from \"@kendevelops/auth-flow-kit\";\n\nexport default function RootLayout({\n  children,\n}: {\n  children: React.ReactNode;\n}) {\n  return (\n    \u003chtml lang=\"en\"\u003e\n      \u003cbody\u003e\n        \u003cAuthProvider\n          config={{\n            baseURL: \"https://your-backend-url.com\",\n            endpoints: {\n              login: \"/auth/login\",\n              signup: \"/auth/signup\",\n              forgot: \"/auth/forgot\",\n            },\n          }}\n        \u003e\n          {children}\n        \u003c/AuthProvider\u003e\n      \u003c/body\u003e\n    \u003c/html\u003e\n  );\n}\n```\n\nThis makes auth **global** and available everywhere.\n\n---\n\n## Step 2: Use auth screens in `app/page.tsx`\n\n```tsx\n// app/page.tsx\n\"use client\";\n\nimport {\n  LoginScreen,\n  SignupScreen,\n  PasswordResetScreen,\n  Protected,\n  useAuth,\n} from \"@kendevelops/auth-flow-kit\";\n\nimport { useEffect, useState } from \"react\";\n\nexport default function Home() {\n  const { user } = useAuth();\n  const [page, setPage] = useState\u003c\"login\" | \"signup\" | \"reset\" | \"dashboard\"\u003e(\n    \"login\"\n  );\n\n  // Keep UI in sync with auth (important on refresh)\n  useEffect(() =\u003e {\n    if (user) setPage(\"dashboard\");\n  }, [user]);\n\n  return (\n    \u003c\u003e\n      {page === \"login\" \u0026\u0026 \u003cLoginScreen /\u003e}\n      {page === \"signup\" \u0026\u0026 \u003cSignupScreen /\u003e}\n      {page === \"reset\" \u0026\u0026 \u003cPasswordResetScreen /\u003e}\n\n      {page === \"dashboard\" \u0026\u0026 (\n        \u003cProtected\u003e\n          \u003cDashboard /\u003e\n        \u003c/Protected\u003e\n      )}\n    \u003c/\u003e\n  );\n}\n\nfunction Dashboard() {\n  const { user, logout } = useAuth();\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003eDashboard\u003c/h1\u003e\n      \u003cp\u003eWelcome {user?.name}\u003c/p\u003e\n      \u003cbutton onClick={logout}\u003eLogout\u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n---\n\n# 🔒 Protecting Components\n\nWrap anything that requires authentication:\n\n```tsx\n\u003cProtected\u003e\n  \u003cSecretArea /\u003e\n\u003c/Protected\u003e\n```\n\n- While loading → shows a loading state\n- If not authenticated → renders nothing (or redirects if configured)\n\n---\n\n# 🧠 Using `useAuth()` Anywhere\n\n```tsx\n\"use client\";\nimport { useAuth } from \"@kendevelops/auth-flow-kit\";\n\nexport default function Navbar() {\n  const { user, logout } = useAuth();\n\n  return (\n    \u003cnav\u003e\n      {user ? (\n        \u003c\u003e\n          \u003cspan\u003eHello {user.name}\u003c/span\u003e\n          \u003cbutton onClick={logout}\u003eLogout\u003c/button\u003e\n        \u003c/\u003e\n      ) : (\n        \u003cspan\u003eNot logged in\u003c/span\u003e\n      )}\n    \u003c/nav\u003e\n  );\n}\n```\n\n---\n\n# 🌐 React (Non‑Next.js) Usage\n\n```tsx\nimport { AuthProvider, LoginScreen } from \"@kendevelops/auth-flow-kit\";\n\nexport default function App() {\n  return (\n    \u003cAuthProvider\n      config={{\n        baseURL: \"https://your-backend-url.com\",\n        endpoints: {\n          login: \"/auth/login\",\n          signup: \"/auth/signup\",\n          forgot: \"/auth/forgot\",\n        },\n      }}\n    \u003e\n      \u003cLoginScreen /\u003e\n    \u003c/AuthProvider\u003e\n  );\n}\n```\n\n---\n\n# 🎯 Who This Library Is For\n\n- Developers who want to go straight into building their app before worrying about auth\n- MVP builders\n- SaaS dashboards\n- Internal tools\n- Learners who want to understand authentication\n\nIf you already have a backend and just want auth to **work**, this library is for you.\n\n---\n\n# 🎉 Summary\n\n**auth-flow-kit** gives you:\n\n- Global auth state (no reducers, no stores)\n- Prebuilt auth UI screens\n- Simple backend requirements\n- Refresh‑safe authentication\n- Works with Next.js and plain React\n\nAuthentication, without the chaos.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethnnabuife%2Fauth-flow-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennethnnabuife%2Fauth-flow-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennethnnabuife%2Fauth-flow-kit/lists"}