{"id":20630749,"url":"https://github.com/teamhanko/passkeys-next-auth-starter","last_synced_at":"2025-04-15T18:23:58.258Z","repository":{"id":215408171,"uuid":"738183876","full_name":"teamhanko/passkeys-next-auth-starter","owner":"teamhanko","description":"Next.js starter using NextAuth and Hanko Passkey API","archived":false,"fork":false,"pushed_at":"2024-05-02T12:00:55.000Z","size":2386,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T17:13:02.595Z","etag":null,"topics":["nextjs","passkey","typescript","webauthn"],"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/teamhanko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-01-02T16:17:14.000Z","updated_at":"2024-05-02T12:00:58.000Z","dependencies_parsed_at":"2024-04-08T14:52:49.921Z","dependency_job_id":null,"html_url":"https://github.com/teamhanko/passkeys-next-auth-starter","commit_stats":null,"previous_names":["ashutosh-bhadauriya/hanko-passkey-starter"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-next-auth-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-next-auth-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-next-auth-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamhanko%2Fpasskeys-next-auth-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teamhanko","download_url":"https://codeload.github.com/teamhanko/passkeys-next-auth-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249126982,"owners_count":21216901,"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":["nextjs","passkey","typescript","webauthn"],"created_at":"2024-11-16T14:09:26.920Z","updated_at":"2025-04-15T18:23:58.233Z","avatar_url":"https://github.com/teamhanko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Integrating Passkey Authentication in a Next.js App using NextAuth and Hanko Passkey API\n\nThis repository demonstrates how to add passkey login functionality to your Next.js app using NextAuth and Hanko Passkey API. Passkey authentication is a secure and user-friendly alternative to traditional password-based authentication, providing a seamless login experience for users.\n\nFor a detailed tutorial on implementing passkey login in your Next.js app using NextAuth, refer to our blog post: [Add passkeys to your Next.js app using NextAuth](https://www.hanko.io/blog/passkeys-nextjs-nextauth)\n\n![Passkey demo](/passkey.gif)\n\n## Prerequisites\n\nBefore you begin, ensure you have the following:\n\n- Node.js installed (version 20.0.0 or later)\n- Hanko Passkey API key and tenant ID from [Hanko Cloud](https://cloud.hanko.io/)\n- Resend API key from [Resend](https://resend.com/)\n- DB URL. In this case we are using [Supabase](https://supabase.com/)\n\n## Technologies used\n\n- Next.js\n- [Next-Auth](https://authjs.dev/) \n- [Resend](https://resend.com/)\n- [Shadcn UI](https://ui.shadcn.com/)\n- [Supabase](https://supabase.com/)\n- [Prisma](https://www.prisma.io/)\n- [Hanko Passkey API](https://www.hanko.io/features/hanko-passkey-api)\n\n\u003e **Note:**\n\u003e You'll need to create a Passkey Project on Hanko Cloud with the App URL `http://localhost:3000`. See our docs to learn how to setup a [passkey project](https://docs.hanko.io/passkey-api/setup-passkey-project).\n\n## Getting started\n\n1. Clone the repository\n\n```bash\ngit clone https://github.com/teamhanko/passkeys-next-auth-starter.git\n```\n\n2. Set up environment variables\n\n   * Create a `.env` file in the root directory and add the following environment variables:\n\n    ```sh\n    NEXTAUTH_SECRET=random-string\n    NEXTAUTH_URL=http://localhost:3000\n\n    GITHUB_ID=\n    GITHUB_SECRET_ID=\n\n    # for email service\n    EMAIL_SERVER_USER=resend\n    EMAIL_SERVER_PASSWORD=your-resend-api-key\n    EMAIL_SERVER_HOST=smtp.resend.com\n    EMAIL_SERVER_PORT=465\n    EMAIL_FROM=onboarding@resend.dev\n\n    DATABASE_URL=your-db-url\n\n    PASSKEYS_API_KEY=your-hanko-passkey-api-key\n    NEXT_PUBLIC_PASSKEYS_TENANT_ID=your-hanko-passkey-tenant-id\n    ```\n\n   * Replace `your-hanko-passkey-api-key` and `your-hanko-passkey-tenant-id` with your actual Hanko Passkey API key and tenant ID.\n\n1. Install the dependencies using your preferred package manager (e.g., `npm`, `pnpm`, `yarn`, or `bun`). For this project, we've used `pnpm`:\n\n```bash\npnpm install\n```\n\n4. Start the development server:\n\n```bash\npnpm dev\n```\n\n## Usage\n\n1. Start the application:\n\n   - Access the application by navigating to `http://localhost:3000` in your web browser.\n\n2. Sign up using email or GitHub.\n\n3. Register a passkey:\n\n   - After logging in, register a passkey for the logged-in user.\n\n4. Log out:\n\n   - After the passkey registration is successful, log out of the application.\n\n5. Login with with a passkey\n\n   - On the login page, choose sign in with a passkey option to authenticate using a passkey.\n\n## Support\n\nFeel free to reach out to us on [Discord](https://hanko.io/community) if you get into any issues.\n\n## License\n\nThis project is licensed under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamhanko%2Fpasskeys-next-auth-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamhanko%2Fpasskeys-next-auth-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamhanko%2Fpasskeys-next-auth-starter/lists"}