@passlock/browser

Flexible passkey authentication for Astro, SvelteKit, NextJS and other frameworks
5,281 192
Install
npm install @passlock/browser
Latest Version:2.10.0
License:MIT
Last Updated:Sep 17, 2026
Links: GitHub  ·  npm
Maintainer: toby.hobson

Passkey Authentication for TypeScript apps

Next generation passkey authentication for Astro, SvelteKit, Angular and other frameworks.
Project website »
GitHub · Documentation · Quick start · Demo


Key Features

Powerful passkey features for browser applications.

  1. 🔓 No lock-in
    Framework agnostic. Standards compliant.

  2. 🔑 Domain migration
    Use backend-authorized RP IDs with WebAuthn /.well-known/webauthn support.

  3. 🚀 Zero config passkeys
    Works out of the box with sensible defaults.

  4. 📱 Credential management
    Programmatically manage passkeys on end user devices

  5. 💪 Powerful
    User verification, autofill, roaming authenticators and more.

Register a passkey

Passkey registration starts on your backend. Use @passlock/server to authorize a registration for the application user, return the resulting registrationToken to the browser, then pass that token to registerPasskey.

import { registerPasskey } from "@passlock/browser"

const result = await registerPasskey(
  { registrationToken },
  { tenancyId: "your-tenancy-id" }
)

if (result.success) {
  // Send this code to your backend and verify it there.
  console.log(result.value.code)
}

if (result.failure) {
  console.error(result.error.message)
}

registerPasskey redeems the one-time registration token for WebAuthn creation options, asks the authenticator to create the passkey, and verifies the result with Passlock.

Your backend chooses the RP ID when it authorizes registration or authentication. The browser library does not accept an RP ID directly; it uses the WebAuthn options returned by Passlock. During domain migration, publish the RP ID domain's /.well-known/webauthn file so browsers and authenticators can enforce related-origin eligibility.

More information

Please see the tutorial and documentation

Related Packages

@hellyeah/x-ray

Multi-platform analytics SDK for browser, React, Next.js, Remix, Vue, Svelte, Nu...

20,021
@noho-digital/remix-icons-svg

All ~3200 Remix Icons as importable SVG strings with framework wrapper component...

12,438
ziko-wrapper

integrate zikojs elements within other ui framework like vue react solidjs svelt...

5,604 49
@edgeone/framework-detect

A framework detection library for web projects

169,969
sveltease

Seamlessly integrate svelte with vue, react with vite, react with cra and next.j...

1,274 11

Version History

Version Released License
2.10.0 MIT
2.9.3 MIT
2.9.2 MIT
2.9.1 MIT
2.9.0 MIT