Skip to content

Passkey quickstart guide

Passlock abstracts much of the complexity associated with passkeys. You should be able to add passkey authentication to your web app in less than 30 minutes.

Passlock is framework agnostic. For this guide we won’t assume any particular framework. We’ll focus on the Passlock libraries. We assume you understand your chosen framework.

Most modern browsers now suport passkeys, so support should not be an issue. The underlying WebAuthn APIs require client side Javascript, so if you need to support browsers that have Javascript disabled you’ll need to fallback to another mechanism.

We assume your frontend uses a bundler with tree shaking support (Vite, Webpack etc.)

Your backend can be coded in pretty much any language and framework. We offer a framework agnostic JS/TS server library, which is what we’ll use in this guide. If you’re not using a JS backend, dont worry - we’ll also show you how to verify passkeys using REST calls.

The only library you need is the Passlock client library. Install it in your frontend project:

Terminal window
npm i @passlock/client

If you’re running a NodeJS backend we recommend installing this library:

Terminal window
npm i @passlock/node

We’ll create a (free) Passlock cloud instance for this tutorial:

Terminal window
npx @passlock/cli init

The script will ask for your first name, last name and email. Make sure you have access to the email account as single use codes will be emailed here.

Follow the prompts and take a note of your Tenancy ID and API Key:

Using the Passlock CLI to create a cloud instance