Skip to content

v0.2 feat: passkey (WebAuthn) support via better-auth passkey plugin #14

@gitcoder89431

Description

@gitcoder89431

Feature — Passkeys (WebAuthn / FIDO2)

Better Auth ships a first-party passkey plugin. Passkeys are the biggest UX win you can add to an auth server in 2026 — no password, no TOTP codes, just biometrics or hardware key. Browser support is universal.

Server setup

import { passkey } from 'better-auth/plugins'

export const auth = betterAuth({
  plugins: [
    passkey({
      rpName: 'Vibe Auth',
      rpID: process.env.BETTER_AUTH_URL
        ? new URL(process.env.BETTER_AUTH_URL).hostname
        : 'localhost',
    }),
  ],
})

Client setup (vibe_client)

import { passkeyClient } from 'better-auth/client/plugins'

export const authClient = createAuthClient({
  plugins: [passkeyClient()],
})

// Register
await authClient.passkey.addPasskey()
// Sign in
await authClient.signIn.passkey()

UX considerations

Mobile note

For Expo/React Native users, there's a community plugin expo-better-auth-passkey that wraps the web plugin for iOS, macOS, and Android.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions