Skip to content

This is a sample repository of a Next.js app with TypeScript that offers passkey authentication.

License

Notifications You must be signed in to change notification settings

nicolaistein/example-passkeys-nextjs

 
 

Repository files navigation

Complete passkeys integration example for Next.js (TypeScript) with Corbado

This is a sample implementation of the Corbado webcomponent being integrated into a web application built with Next.js.

File structure

  • src/app/page.tsx: the file where the web component is embedded
  • pages/profile.tsx: displays user information if the user has successfully authenticated
  • delcarations.d.ts: contains type declarations you need to add as well to make the web component work in TypeScript
  • .env: add relevant environment variables that you can obtain from Corbado developer panel

Setup

Prerequisites

Please follow the steps in Getting started to create and configure a project in the Corbado developer panel.

You need to have Node and npm installed to run it.

Configure environment variables

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

NEXT_PUBLIC_PROJECT_ID=<YOUR PROJECT ID>
API_SECRET=<YOUR API SECRET>

Usage

Run

npm i

to install all dependencies.

Finally, you can run the project locally with

npm run dev

About

This is a sample repository of a Next.js app with TypeScript that offers passkey authentication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.8%
  • JavaScript 2.4%
  • CSS 0.8%