Sign users in with a passkey
Passwordless account access
Auth.js · Const
Passkey enables WebAuthn registration and authentication in Auth.js. It requires a compatible database adapter, an Authenticator table, and explicit experimental WebAuthn enablement.
Passkey adds WebAuthn-based registration and authentication to Auth.js. Configure it with a supported database adapter, enable the experimental WebAuthn flag, and use the built-in page or the WebAuthn sign-in helper for a custom page.
import Passkey from "next-auth/providers/passkey"import Passkey from "next-auth/providers/passkey"
import { PrismaAdapter } from "@auth/prisma-adapter"
import { PrismaClient } from "@prisma/client"
const prisma = new PrismaClient()
export default {
adapter: PrismaAdapter(prisma),
providers: [Passkey],
experimental: { enableWebAuthn: true },
}This config registers the Passkey provider, supplies a Prisma database adapter, and enables Auth.js's experimental WebAuthn support.
Passwordless account access
New credential enrollment
Minimal integration
Passkey uses WebAuthn to provide passwordless registration and authentication. It must be configured with the provider, a compatible database adapter, and experimental WebAuthn enabled.
Follow-up: What persistence is needed? The adapter must support the additional Authenticator table required to store passkey credentials.
The built-in Auth.js pages can expose the passkey sign-in action after configuration. A custom page can call the WebAuthn-aware sign-in function instead.
Follow-up: How can a custom page distinguish the two flows? Use the passkey action with an action value of register for registration; omit it for sign-in.
Passkey support is limited to documented framework and adapter versions, and the provider remains experimental. The project must therefore use compatible integration and database packages.
Follow-up: What database schema change is required? Add the Authenticator table through the migration instructions for the chosen adapter.
WebAuthnAuthenticatorexperimental.enableWebAuthnnext-auth/webauthn signInPrismaAdapter