Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Next.js (TypeScript) repository of a sample app that offers passkey authentication.

License

NotificationsYou must be signed in to change notification settings

corbado/example-passkeys-nextjs

Repository files navigation

GitHub Repo Cover

Next.js (TypeScript) Passkey Example App

This is a sample implementation of the Corbado React package and Corbado Node SDK being integrated into a web application built with Next.js.

Please see thefull blog post to understand the detailed steps needed to integrate passkeys into Next.js apps.

File structure

  • app/auth/page.tsx: the file where the React Auth component is used
  • app/profile/page.tsx: displays user information if the user has successfully authenticated (rendered on the server)
  • app/user-data/route.ts: api route that checks the users authentication state using the Corbado Node SDK
  • app/page.tsx: client rendered page that accesses data from the above mentioned route
  • .env.local: add relevant environment variables that you can obtainfromCorbado developer panel

Setup

Prerequisites

Please follow the steps inGetting started to create and configurea project in theCorbado developer panel.

You need to haveNode andnpm installed to run it.

Configure environment variables

Use the values you obtained inPrerequisites to configure the following variables inside an.env.localfile you create in the root folder of this project:

NEXT_PUBLIC_CORBADO_PROJECT_ID=<YOUR PROJECT ID>CORBADO_API_SECRET=<YOUR API SECRET>CORBADO_FRONTEND_API=<YOUR FRONTEND API>CORBADO_BACKEND_API=<YOUR BACKEND API>

Usage

Run the project locally

Run

npm i

to install all dependencies.

Finally, you can run the project locally with

npm run dev

Run the project in a docker container

You can also run the project in a docker container using the provideddocker-compose.yml file.

docker-compose up --build

About

Next.js (TypeScript) repository of a sample app that offers passkey authentication.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp