Best Passkey/WebAuthn Library for Node.js in 2026
SimpleWebAuthn wins on every measure — 803K weekly downloads, FIDO conformant, TypeScript-native. Here is what to install and when to pick something else.
By Ethan
1,478 words · 8 min read
SimpleWebAuthn is the right library for most Node.js passkey integrations. It handles 803K npm downloads a week, passes the FIDO Alliance conformance test suite, and ships TypeScript-native across Node, Deno, Bun, and Cloudflare Workers. Nothing else in this comparison is close.
There are two cases where you’d reach for something else: a zero-dependency edge environment (use @passwordless-id/webauthn) and deep enterprise TPM attestation (use fido2-lib). The recommendation matrix at the bottom covers both.
Who this is for
Node.js developers picking a WebAuthn server library before starting — or reconsidering — a passwordless auth implementation. If you want managed passkey infrastructure rather than a library, skip to SaaS alternatives. This comparison covers open-source libraries only.
Libraries at a glance
| Library | npm weekly DLs | Stars | Latest release | TypeScript | FIDO conformant |
|---|---|---|---|---|---|
@simplewebauthn/server | ~803K | 2,251 | v13.3.0 (Mar 2026) | Native | ✅ |
@passwordless-id/webauthn | ~22K | 604 | v2.4.0 (May 2026) | Bundled ESM | ❌ |
fido2-lib | ~11.6K | 446 | v3.5.9 (Mar 2026) | JS + types | ❌ |
| Auth.js Passkeys provider | bundled with next-auth | — | Experimental | Native | via SimpleWebAuthn (pinned 9.x) |
Source: npmtrends, GitHub repo pages. Fetched 2026-05-27.
Pruned candidates
A few libraries showed up in searches and were excluded:
- webauthn4js — Node.js bindings to a Wasm/Go library; last published over two years ago.
- node-webauthn — last published 2021; dead.
- @teamhanko/passkeys-sdk — this is a typed HTTP client for Hanko’s SaaS passkey API, not a standalone WebAuthn implementation. Under 500 weekly downloads and last published Sep 2025. Hanko’s product belongs in the SaaS section, not the library comparison.
SimpleWebAuthn
Best for: new integrations, any runtime, any scale.
SimpleWebAuthn has been the de facto standard for Node.js WebAuthn since it passed FIDO Alliance conformance tests at v0.7.0. It now ships 86 releases in, with 2,251 GitHub stars, 192 forks, and a download count that dwarfs every alternative.
Version 13.0.0 added registration hints that let you suggest the type of authenticator to the browser:
const options = await generateRegistrationOptions({
rpName: 'My App',
rpID: 'myapp.com',
userID: Uint8Array.from(userId, c => c.charCodeAt(0)),
userName: userEmail,
authenticatorSelection: {
preferredAuthenticatorType: 'localDevice', // 'securityKey' | 'localDevice' | 'remoteDevice'
},
})
The whole registration ceremony is two server calls around one browser call:
// 1. Server: generate challenge + options
const options = await generateRegistrationOptions({ rpName, rpID, userID, userName })
// 2. Browser: call WebAuthn API
const response = await startRegistration({ optionsJSON: options })
// 3. Server: verify response, get credential to store
const { verified, registrationInfo } = await verifyRegistrationResponse({
response,
expectedChallenge: options.challenge,
expectedOrigin: 'https://myapp.com',
expectedRPID: 'myapp.com',
})
Authentication follows the same shape with generateAuthenticationOptions and verifyAuthenticationResponse. Once you understand the ceremony structure, the API stays out of your way.
Why FIDO conformance matters: the FIDO Alliance runs a formal test suite against all attestation statement formats and credential verification paths. A library that skips conformance testing may still work for most registrations — but WebAuthn has enough optional paths and edge cases that untested implementations accumulate surprises. SimpleWebAuthn is the only open-source Node.js WebAuthn library that passes the FIDO Alliance conformance test suite.
Runtime support is broad: Node LTS 20+, Deno 1.43+ (and 2.x), Bun, and Cloudflare Workers. The packages are dual-published to npm and JSR.
The one real risk: single-maintainer bus factor. MasterKale has built and maintained this project solo across 86 releases. That track record is real. So is the dependency on one person. If you build a production system on SimpleWebAuthn, keep an eye on the project’s activity.
@passwordless-id/webauthn
Best for: edge environments, strict bundle-size constraints, or zero-dependency requirements.
This library does what its name promises: it has zero dependencies. The entire thing ships as a small ES module. No transitive dependency chain, no node_modules bloat.
It runs on server and browser from the same package. v2.4.0 landed in May 2026 with one open GitHub issue — one of the tidier issue trackers you’ll find on an auth project.
The API surface is deliberately simpler than SimpleWebAuthn. Fewer options, fewer attestation knobs. That’s a genuine trade-off: less complexity for you to manage, but less ability to configure edge cases. For consumer-facing applications where passkeys are a convenience feature, the simpler surface is an advantage. For enterprise deployments where attestation format selection matters, it’s a constraint.
No FIDO Alliance conformance certification. That matters in enterprise procurement. For most production consumer applications, the practical security difference is small — the core WebAuthn ceremony is the same.
Downloads sit at ~22K weekly, 36× lower than SimpleWebAuthn. That gap shows up in community resources: fewer answered questions, less third-party tooling, less battle-tested documentation. It is not a measure of code quality, but it is a real difference in ecosystem support.
fido2-lib
Best for: enterprise deployments requiring TPM attestation or formal certificate chain validation.
fido2-lib exposes WebAuthn server primitives directly. Where SimpleWebAuthn gives you generateRegistrationOptions and verifyRegistrationResponse, fido2-lib gives you attestationOptions, attestationResult, assertionOptions, and assertionResult. More control, more code to write.
The reason to choose it is attestation format depth. It supports packed, TPM, Android SafetyNet, FIDO U2F, Apple, and includes NIST PKITS chain validation. If you’re deploying to an enterprise environment where hardware security keys require full attestation verification with certificate chain validation up to a known trust anchor, this is the only open-source Node library that covers it.
At ~11.6K weekly downloads, it has a real user base — primarily security engineers and enterprise teams who need protocol-close control. v3.5.9 shipped in March 2026.
The trade-offs: 23 open GitHub issues, JavaScript source with types rather than TypeScript source (type definitions live in a /types directory and can lag the implementation), and no FIDO Alliance conformance testing — notable for a library focused on attestation correctness. Writing the basic passkey registration and authentication flows with fido2-lib requires meaningfully more code than SimpleWebAuthn.
Use fido2-lib when TPM attestation or NIST PKITS chain validation is a hard requirement. For everything else, the verbosity costs more than it returns.
Auth.js Passkeys provider
Best for: teams already running Auth.js that want passkeys without a new dependency.
Auth.js (formerly NextAuth.js) ships a Passkey provider inside next-auth v5. Under the hood it pins @simplewebauthn/[email protected] and @simplewebauthn/[email protected] — both several major versions behind the current 13.3.0.
The Auth.js team labels this feature experimental and does not recommend it for production yet. It requires a database adapter and creates an Authenticator table; it’s not suitable for stateless or serverless-first architectures.
The case for it: if you’re already on Auth.js, you get passkeys without adding @simplewebauthn/server as a direct dependency. The integration handles the ceremony mapping for you.
The cost: you’re running a pinned older SimpleWebAuthn version with no clear upgrade timeline, and you’re betting on the Auth.js team unflagging the feature as production-ready. Reasonable bet for internal tools or low-stakes apps; harder to justify for authentication infrastructure you need to trust.
Recommendation matrix
| Scenario | Pick |
|---|---|
| New passkey integration from scratch | SimpleWebAuthn |
| Already on Auth.js / NextAuth | Auth.js Passkeys provider |
| Edge or Workers environment, zero deps required | @passwordless-id/webauthn |
| Enterprise hardware keys, TPM attestation, NIST PKITS | fido2-lib |
| No server library, fully managed passkey infra | Clerk / Descope / Passage |
SaaS alternatives
If you don’t want to run WebAuthn server logic at all, three managed options cover different parts of the market.
Clerk ships passkeys as a first-class, GA feature through their <SignIn /> component. Strongest developer experience of the three; works well with Next.js and other React frameworks. Has a free tier. See our Clerk vs Auth0 comparison for a deeper look at Clerk as an auth provider.
Descope is passkey-first with a generous free tier and no-code flow builders. Good option if you want a visual editor for auth flows alongside the passkey support.
Passage by 1Password targets enterprise deployments, reflecting its 1Password acquisition. Best fit when you need 1Password’s compliance posture and are already in that ecosystem.
None of these are direct comparisons to the open-source libraries above — they abstract the WebAuthn server entirely. The decision between a library and a SaaS comes down to cost at scale, compliance requirements, and how much control you need over the credential lifecycle.
Caveats
Download counts and star numbers were fetched 2026-05-27. SimpleWebAuthn is maintained by one person; its continued health depends on MasterKale’s continued involvement. This comparison reviews documentation, API surfaces, and release history — not production throughput benchmarks. If verification latency at high volume matters for your use case, measure it yourself against your actual workload.