Skip to content

Add passkeys to your Express and Vanillajs application using the Corbado passkey-first authentication solution.

Notifications You must be signed in to change notification settings

corbado/passkeys-vanillajs-express

Repository files navigation

GitHub Repo Cover

Fullstack Express Passkey Example App

This is a sample implementation of the Corbado passkeys-first authentication solution using Vanillajs and Express with TypeScript. The following packages are being used:

File structure

  • src/app.ts: configuration file for the Express app
  • src/utils: collection of utility functions, e.g. helper functions for authentication
  • src/routes: directory configuring the routes for the app
  • src/controller: controllers for the routes
  • src/middleware: middleware, e.g. for authentication
  • views: ejs templates for the app
  • public: static files
  • .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:

CORBADO_PROJECT_ID=pro-XXX
CORBADO_API_SECRET=corbado1_XXX
CORBADO_FRONTEND_API=https://${CORBADO_PROJECT_ID}.frontendapi.cloud.corbado.io
CORBADO_BACKEND_API=https://backendapi.cloud.corbado.io

Usage

Run the project locally

Run

npm i

to install all dependencies.

Finally, you can run the project locally with

npm run start

Passkeys support

About

Add passkeys to your Express and Vanillajs application using the Corbado passkey-first authentication solution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published