{"id":20414318,"url":"https://github.com/nuxt-modules/hanko","last_synced_at":"2026-06-08T23:01:17.739Z","repository":{"id":172791675,"uuid":"649748157","full_name":"nuxt-modules/hanko","owner":"nuxt-modules","description":"Hanko integration for Nuxt","archived":false,"fork":false,"pushed_at":"2026-06-08T21:29:14.000Z","size":3117,"stargazers_count":61,"open_issues_count":8,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-06-08T22:24:16.850Z","etag":null,"topics":["authentication","hanko","nuxt","nuxt-module","passkey","web-authn"],"latest_commit_sha":null,"homepage":"","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/nuxt-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","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},"funding":{"github":["danielroe"]}},"created_at":"2023-06-05T14:46:35.000Z","updated_at":"2026-06-08T21:17:10.000Z","dependencies_parsed_at":"2025-11-27T11:01:12.124Z","dependency_job_id":null,"html_url":"https://github.com/nuxt-modules/hanko","commit_stats":{"total_commits":251,"total_committers":5,"mean_commits":50.2,"dds":0.3266932270916335,"last_synced_commit":"d0ce16199a57ce3ee46ce0230582c85344ae4661"},"previous_names":["danielroe/nuxt-hanko","nuxt-modules/hanko"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/nuxt-modules/hanko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fhanko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fhanko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fhanko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fhanko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxt-modules","download_url":"https://codeload.github.com/nuxt-modules/hanko/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fhanko/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34083848,"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-06-08T02:00:07.615Z","response_time":111,"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":["authentication","hanko","nuxt","nuxt-module","passkey","web-authn"],"created_at":"2024-11-15T06:08:59.536Z","updated_at":"2026-06-08T23:01:17.733Z","avatar_url":"https://github.com/nuxt-modules.png","language":"TypeScript","funding_links":["https://github.com/sponsors/danielroe"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Nuxt Hanko\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Github Actions][github-actions-src]][github-actions-href]\n[![Codecov][codecov-src]][codecov-href]\n[![nuxt.care health](https://img.shields.io/endpoint?url=https://nuxt.care/api/badge/hanko)](https://nuxt.care/?search=hanko)\n\n\u003e [Hanko](https://www.hanko.io/) integration for [Nuxt](https://nuxt.com)\n\n- [✨ \u0026nbsp;Changelog](https://github.com/nuxt-modules/hanko/blob/main/CHANGELOG.md)\n\u003c!-- - [▶️ \u0026nbsp;Online playground](https://stackblitz.com/github/nuxt-modules/hanko/tree/main/playground) --\u003e\n- [🎁 \u0026nbsp;Hanko starter](https://github.com/teamhanko/hanko-nuxt-starter)\n\n## Features\n\n- ✨ Easy integration for [Hanko](https://www.hanko.io/)\n- 🧱 Type safety and auto-registration for Hanko web components\n- 💪 Server utilities for full-stack auth\n\n## Installation\n\nInstall and add `@nuxtjs/hanko` to your `nuxt.config`.\n\n```bash\nnpx nuxi@latest module add hanko\n```\n\n```js\nexport default defineNuxtConfig({\n  modules: ['@nuxtjs/hanko'],\n  hanko: {\n    // You can also configure this by setting NUXT_PUBLIC_HANKO_API_URL at runtime\n    apiURL: '\u003cYOUR_API_URL\u003e',\n    // You can also customise these if required\n    // cookieName: 'hanko',\n    // cookieSameSite: 'Lax',\n    // cookieDomain: 'nuxt.com',\n    // storageKey: 'hanko',\n    // redirects: {\n    //   login: '/login',\n    //   success: '/',\n    //   home: '/',\n    //   followRedirect: true\n    // },\n    // registerComponents: true,\n    // augmentContext: true,\n    // components: {\n    //   shadow: true,\n    //   injectStyles: true,\n    //   enablePasskeys: true,\n    //   hidePasskeyButtonOnLogin: true,\n    //   translations: {},\n    //   fallbackLanguage: 'en'\n    // }\n  },\n})\n```\n\n## Usage\n\n### Components\n\nTo use, you can use the Hanko components anywhere in your app: `\u003chanko-auth\u003e`, `\u003chanko-events\u003e` and `\u003chanko-profile\u003e`. These are web components that will be rendered on the client-side only. Props are typed.\n\nYou can turn auto-registration of components off (if you wish to use Hanko just on the server side or programmatically) with `registerComponents: false`.\n\nCheck out the [Hanko documentation](https://docs.hanko.io/guides/vue) to learn more.\n\n```vue\n\u003ctemplate\u003e\n  \u003chanko-auth /\u003e\n\u003c/template\u003e\n```\n\n### Middleware\n\nBy default two new route middleware are available in your Nuxt app: `hanko-logged-in` and `hanko-logged-out`.\n\n- `hanko-logged-in` will prevent access to a page unless you are logged in. (It will redirect you to `redirects.login` instead, and then redirect back to this page once you login. You can disable this behaviour by setting `redirects.followRedirect` to `false`.)\n- `hanko-logged-out` will prevent access to a page unless you are logged out. (It will redirect you to `redirects.success` when you log in, and otherwise to `redirects.home`.)\n\nYou can also create your own middleware for full control.\n\n### Auto-imports\n\n`useHanko` is exposed in the Vue part of your app to allow you direct access to the Hanko API. You can access the current user and much more. **Note**: It will return `null` on the server.\n\n### Server utilities\n\nBy default you can access a verified JWT context on `event.context.hanko`. (It will be undefined if the user is not logged in.) If you want to handle this yourself you can set `augmentContext: false`.\n\n`verifyHankoEvent` is exposed in the Nitro part of your app to expose the underlying utility used to create `event.context.hanko` if you want to handle things manually.\n\n## 💻 Development\n\n- Clone this repository\n- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n- Install dependencies using `pnpm install`\n- Stub module with `pnpm dev:prepare`\n- Run `pnpm dev` to start [playground](./playground) in development mode\n\n## Credits\n\nThanks to [@McPizza0](https://github.com/McPizza0) for the push to make the module!\n\n## License\n\nMade with ❤️\n\nPublished under the [MIT License](./LICENCE).\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://npmx.dev/api/registry/badge/version/@nuxtjs/hanko\n[npm-version-href]: https://npmx.dev/package/@nuxtjs/hanko\n[npm-downloads-src]: https://npmx.dev/api/registry/badge/downloads/@nuxtjs/hanko\n[npm-downloads-href]: https://npm.chart.dev/@nuxtjs/hanko\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/nuxt-modules/hanko/ci.yml?branch=main\n[github-actions-href]: https://github.com/nuxt-modules/hanko/actions?query=workflow%3Aci\n[codecov-src]: https://img.shields.io/codecov/c/gh/nuxt-modules/hanko/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/nuxt-modules/hanko\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-modules%2Fhanko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxt-modules%2Fhanko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-modules%2Fhanko/lists"}