{"id":51405282,"url":"https://github.com/alyldas/uniauth-nuxt","last_synced_at":"2026-07-04T10:31:41.912Z","repository":{"id":360734849,"uuid":"1250377774","full_name":"alyldas/uniauth-nuxt","owner":"alyldas","description":"Nuxt module, composables, and server helpers for UniAuth-backed applications.","archived":false,"fork":false,"pushed_at":"2026-05-27T18:07:57.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T18:12:33.570Z","etag":null,"topics":["auth","authentication","module","nuxt","typescript","uniauth","vue"],"latest_commit_sha":null,"homepage":"https://github.com/alyldas/uniauth-nuxt#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alyldas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-26T15:12:42.000Z","updated_at":"2026-05-27T18:08:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alyldas/uniauth-nuxt","commit_stats":null,"previous_names":["alyldas/uniauth-nuxt"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alyldas/uniauth-nuxt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-nuxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-nuxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-nuxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-nuxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alyldas","download_url":"https://codeload.github.com/alyldas/uniauth-nuxt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alyldas%2Funiauth-nuxt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35118970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","module","nuxt","typescript","uniauth","vue"],"created_at":"2026-07-04T10:31:41.256Z","updated_at":"2026-07-04T10:31:41.898Z","avatar_url":"https://github.com/alyldas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @alyldas/uniauth-nuxt\n\n[![GitHub Packages](https://img.shields.io/static/v1?label=GitHub%20Packages\u0026message=%40alyldas%2Funiauth-nuxt\u0026color=24292f\u0026logo=github)](https://github.com/users/alyldas/packages/npm/package/uniauth-nuxt)\n\nNuxt module for applications that use a UniAuth-powered backend API.\n\n## Runtime Boundary\n\nThis package does not create auth records, verify passwords, issue sessions, or own cookies. It only\nforwards Nuxt SSR and browser calls to the backend API and exposes Nuxt-friendly helpers.\n\n## Install\n\nConfigure the GitHub Packages registry for the package scope before installing:\n\n```ini\n@alyldas:registry=https://npm.pkg.github.com\n```\n\nGitHub Packages can require authentication for package reads. Use a token with `read:packages` in local npm config or CI secrets; do not commit tokens.\n\n```sh\nnpm install @alyldas/uniauth-nuxt nuxt\n```\n\nBy default, the module expects `@alyldas/uniauth-express` mounted at `/auth`:\n\n- `GET /auth/account/session`\n- `POST /auth/password/sign-in`\n- `POST /auth/account/sessions/revoke-current`\n- `POST /auth/account/session/refresh`\n\n```ts\nexport default defineNuxtConfig({\n  modules: [\"@alyldas/uniauth-nuxt\"],\n  uniauth: {\n    apiBase: process.env.UNIAUTH_API_BASE,\n    redirects: {\n      signIn: \"/sign-in\",\n    },\n  },\n});\n```\n\nAvailable runtime helpers:\n\n- `useSession()`\n- `useAuth()`\n- `requireAuth()`\n- `createUniAuthBackendClient(event)`\n- `getUniAuthSession(event)`\n- `requireUniAuthSession(event)`\n\nProtect a page with the built-in route middleware:\n\n```ts\ndefinePageMeta({\n  middleware: \"auth\",\n});\n```\n\nRead session state in components:\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\nconst { user, authenticated, guest, ready, pending, refresh } = useSession();\nconst { signInWithPassword, logout } = useAuth();\n\u003c/script\u003e\n```\n\nRequire a session in client-side setup:\n\n```ts\nconst { user, session } = await requireAuth();\n```\n\nRequire a session in server handlers:\n\n```ts\nexport default defineEventHandler(async (event) =\u003e {\n  const { user } = await requireUniAuthSession(event);\n\n  return {\n    id: user.id,\n  };\n});\n```\n\nApplications can specialize the default user and session types once:\n\n```ts\ndeclare module \"@alyldas/uniauth-nuxt/types\" {\n  interface UniAuthUser {\n    readonly roles?: readonly string[];\n  }\n\n  interface UniAuthSession {\n    readonly tenantId?: string;\n  }\n}\n```\n\n## Migration Notes\n\nUse the session context as the single source of truth for the current user:\n\n```ts\nconst { user, session, authenticated } = useSession();\n```\n\nThe package does not expose a separate current-user composable, helper, endpoint option, or proxy\nroute. Code that previously read the current user separately should read `useSession().user` on the\nclient, or `getUniAuthSession(event)?.user` / `requireUniAuthSession(event).user` on the server.\n\n## Security Notes\n\n- Keep backend origin and proxy rules in server-controlled runtime config.\n- Do not put provider secrets or UniAuth core runtime objects in Nuxt public config.\n- Treat this package as a frontend/SSR integration layer, not an auth backend.\n\n## Local Checks\n\n```sh\nnpm run check\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falyldas%2Funiauth-nuxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falyldas%2Funiauth-nuxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falyldas%2Funiauth-nuxt/lists"}