Skip to main content

Installation

Install webauthn-server-buildkit from npm with a single command. It is a pure Node.js library with one runtime dependency (cbor-x) and no native build step.

# yarn (recommended)
yarn add webauthn-server-buildkit

# npm
npm install webauthn-server-buildkit

# pnpm
pnpm add webauthn-server-buildkit

Requirements

RequirementDetail
Node.js>= 24.13.0 (engines.node). The library relies on modern Node crypto (JWK key import, Ed25519, AES-256-GCM, HKDF).
TypeScriptOptional but recommended. Types ship in the package; no @types/* needed.
Secure contextWebAuthn requires HTTPS in production (or http://localhost during development). This is a browser/transport requirement, not something the library can relax.

Importing

The package ships both ESM and CommonJS builds plus full type declarations, so either module system works.

// ESM / TypeScript
import { WebAuthnServer, MemoryStorageAdapter } from 'webauthn-server-buildkit';
// CommonJS
const { WebAuthnServer, MemoryStorageAdapter } = require('webauthn-server-buildkit');

Verifying the install

A minimal sanity check — constructing a server with the in-memory adapter — confirms the package resolves and your config is valid:

import { WebAuthnServer, MemoryStorageAdapter } from 'webauthn-server-buildkit';

const webauthn = new WebAuthnServer({
rpName: 'My App',
rpID: 'localhost',
origin: 'http://localhost:3000',
encryptionSecret: 'dev-secret-at-least-32-characters-long',
storageAdapter: new MemoryStorageAdapter(),
});

console.log('WebAuthn server ready');

If encryptionSecret is shorter than 32 characters, or rpName / rpID / origin are missing, the constructor throws a ConfigurationError immediately — fail-fast by design.

Next steps

  • Quick Start — a complete registration + authentication round trip.
  • Configuration — all configuration options and their defaults.