Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Auth.js · Const

Passkey

Passkey enables WebAuthn registration and authentication in Auth.js. It requires a compatible database adapter, an Authenticator table, and explicit experimental WebAuthn enablement.

How it works

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.

Syntax

import Passkey from "next-auth/providers/passkey"

Key points

  • Register Passkey in the providers list and pair it with an adapter version supported by the documentation.
  • Set experimental.enableWebAuthn to true before WebAuthn flows can be used.
  • Extend the database schema with the Authenticator table using the migration instructions for the selected adapter.
  • With built-in pages, the sign-in route supplies a passkey button after configuration is complete.
  • Custom pages can invoke the WebAuthn sign-in helper for both registering and authenticating passkeys.

Common mistakes

  • The provider is experimental, so the documentation does not recommend using it in production yet.
  • A compatible adapter and the additional Authenticator table are required; provider configuration alone is insufficient.
  • Install the browser peer dependency only when implementing a custom sign-in page; built-in Auth.js pages do not need it.

Example: Enable Passkeys in Auth.js

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.

When to use it

Sign users in with a passkey

Passwordless account access

Register a passkey from a custom page

New credential enrollment

Use Auth.js built-in sign-in pages

Minimal integration

Interview questions

QHow do you enable Passkey support?

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.

QHow are built-in and custom sign-in pages handled?

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.

QWhat compatibility and schema constraints apply?

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.

  • WebAuthn
  • Authenticator
  • experimental.enableWebAuthn
  • next-auth/webauthn signIn
  • PrismaAdapter

Source: Passkey - Auth.js. Checked 2026-10-15.