{"id":21590245,"url":"https://github.com/corbado/example-nextjs-nodejs-passkey-associate","last_synced_at":"2025-04-10T21:56:17.968Z","repository":{"id":182543210,"uuid":"666424319","full_name":"corbado/example-nextjs-nodejs-passkey-associate","owner":"corbado","description":"This is a sample repository of a Next.js (TypeScript) frontend and Node.js (Express) backend app that offers passkey authentication.","archived":false,"fork":false,"pushed_at":"2023-07-26T14:16:38.000Z","size":193,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-10T21:56:01.076Z","etag":null,"topics":["express","faceid","fido2","javascript","nextjs","passkey","passkeys","react","touchid","typescript","webauthn"],"latest_commit_sha":null,"homepage":"https://www.corbado.com","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/corbado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-14T13:35:22.000Z","updated_at":"2025-01-10T10:36:29.000Z","dependencies_parsed_at":"2023-07-20T12:10:02.729Z","dependency_job_id":null,"html_url":"https://github.com/corbado/example-nextjs-nodejs-passkey-associate","commit_stats":null,"previous_names":["corbado/example-nextjs-nodejs-passkey-associate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-nextjs-nodejs-passkey-associate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-nextjs-nodejs-passkey-associate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-nextjs-nodejs-passkey-associate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbado%2Fexample-nextjs-nodejs-passkey-associate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corbado","download_url":"https://codeload.github.com/corbado/example-nextjs-nodejs-passkey-associate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305838,"owners_count":21081574,"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":["express","faceid","fido2","javascript","nextjs","passkey","passkeys","react","touchid","typescript","webauthn"],"created_at":"2024-11-24T16:17:13.965Z","updated_at":"2025-04-10T21:56:17.935Z","avatar_url":"https://github.com/corbado.png","language":"TypeScript","readme":"# Passkeys Integration Example with Next.js (Frontend) and Node.js (Backend)\n\nThis is a sample implementation of the passkey solution integrated into a web application built with Next.js (frontend)\nand Node.js (backend).\n\n## File structure\n\n### Frontend (Next.js)\n\n- `/frontend-nextjs/src/app/page.tsx`: Page with the login / home screen.\n- `/frontend-nextjs/src/pages/profile.tsx`: Page with the profile screen after authentication.\n- `/frontend-nextjs/src/declarations.d.ts`: page for the user profile information that is shown after successful authentication.\n\n### Backend (Node.js)\n\n- `/backend-nodejs/index.js`: main entry point for the backend server.\n\n## Setup\n\n### Prerequisites\n\nPlease follow the steps in [Getting started](https://docs.corbado.com/overview/getting-started) to create and configure\na project in the [Corbado developer panel](https://app.corbado.com/signin#register).\n\nYou need to have [Node](https://nodejs.org/en/download) and `npm` installed to run it. Also, you need to\ninstall [Next.js](https://nextjs.org/learn/basics/create-nextjs-app) if you haven't done so.\n\n## Usage\n\u003e :warning: **Email address change**: Please note, that you need to change the email address in `/frontend-nextjs/src/pages/profile.tsx` (dynamically) to test the association token creation process, and thus the passkey associate process, multiple times.\n\n### Navigate to the frontend folder:\n\n```bash\ncd frontend-nextjs\n```\n\n### Create frontend .env file\nCopy the `.env.example` file, rename it to `.env` and fill the values for `NEXT_PUBLIC_PROJECT_ID` with your Corbado project ID you obtained in [prerequisites](#prerequisites) and `NEXT_PUBLIC_API_BASE_URL` with the URL of your backend. The default value for this repository is `http://localhost:3001`.\n\n### Run\n\n```bash\nnpm i\n```\n\nto install  all dependencies.\n\n### Start the frontend:\n```bash\nnpm run dev\n```\nThis starts the frontend on `PORT=3000`.\n\nNow, open a new terminal and navigate to the backend folder:\n\n```bash\ncd ../backend-nodejs\n```\n\n### Create backend .env file\nCopy the `.env.example` file, rename it to `.env` and fill the values for `PROJECT_ID` and `API_SECRET` with your Corbado project ID and API secret you obtained in [prerequisites](#prerequisites).\n\n### Install dependencies:\n\n```bash\nnpm i\n```\n\n### Start the backend:\n\n```bash\nnode index.js\n```\n\nThe application should now be running on your local machine, with your backend running on `PORT=3001`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fexample-nextjs-nodejs-passkey-associate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorbado%2Fexample-nextjs-nodejs-passkey-associate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbado%2Fexample-nextjs-nodejs-passkey-associate/lists"}