Robot-Inventor

payload passkey

by Robot-Inventor
Authentication & SSO
v3
v4
>=3.69.0 <4
>=4.0.0-beta.0 <4.0.0-canary.0 || >=4.0.0-canary.37 <5 · prerelease
MIT

Overview

Summary generated from the README

Adds passkey sign-in to Payload CMS as a wrapper around Better Auth and the Payload Better Auth plugin. It keeps Payload's default login screen, adds a passkey button and a passkey management section on the account screen. It requires a Better Auth secret, relying party settings and database migrations, and works with Payload 3.69 or later.

Features

  • Passkey login button on Payload's default login screen
  • Passkey management on the account management screen
  • Passkey autofill support
  • Compatible with Payload TOTP when enabled
  • Automatic token refresh when enabled in Payload configuration
  • i18n support

Use cases

  • Let admin users sign in with passkeys instead of typing a password
  • Add passkeys as an alternative to password plus TOTP login in an existing Payload setup

From the author

Add passkey support to Payload CMS.

Installation

npm i payload-passkey

1

Stars

0

Forks

3

Open Issues

5 days ago

Last Updated

516

Weekly Downloads

v3.0.1

npm Version

126.4 KB

Unpacked Size

3

Dependencies

GitHub stars

10 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 20261
Dec 5, 20261
Dec 4, 20261
Dec 3, 20261
Dec 2, 20261
Dec 1, 20261
Nov 30, 20261
Nov 29, 20261
Nov 28, 20261
Nov 27, 20261
Nov 26, 20261
Nov 25, 20261
Nov 24, 20261
Nov 23, 20261
Nov 22, 20261
Nov 21, 20261
Nov 20, 20261
Nov 19, 20261
Nov 18, 20261
Nov 17, 20261
Nov 16, 20261
Nov 15, 20261
Nov 14, 20261
Nov 13, 20261
Nov 12, 20261
Nov 11, 20261
Nov 10, 20261
Nov 9, 20261
Nov 8, 20261
Nov 7, 20261
Nov 6, 20261
Nov 5, 20261
Nov 4, 20261
Nov 3, 20261
Nov 2, 20261
Nov 1, 20261
Oct 31, 20261
Oct 30, 20261
Oct 29, 20261
Oct 28, 20261
Oct 27, 20261
Oct 26, 20261
Oct 25, 20261
Oct 24, 20261
Oct 23, 20261
Oct 22, 20261
Oct 21, 20261
Oct 20, 20261
Oct 19, 20261
Oct 18, 20261
Oct 17, 20261
Oct 16, 20261
Oct 15, 20261
Oct 14, 20261
Oct 13, 20261
Oct 12, 20261
Oct 11, 20261
Oct 10, 20261
Oct 9, 20261
Oct 8, 20261
Oct 7, 20261
Oct 6, 20261
Oct 5, 20261
Oct 4, 20261
Oct 3, 20261
Oct 2, 20261
Oct 1, 20261
Sep 30, 20261
Sep 29, 20261
Sep 28, 20261
Sep 27, 20261
Sep 26, 20261
Sep 25, 20261
Sep 24, 20261
Sep 23, 20261
Sep 22, 20261
Sep 21, 20261
Sep 20, 20261
Sep 19, 20261
Sep 18, 20261
Sep 17, 20261
Sep 16, 20261
Sep 15, 20261
Sep 14, 20261
Sep 13, 20261
Sep 12, 20261
Sep 11, 20261
Sep 10, 20261
Sep 9, 20261
Sep 8, 20261
Sep 7, 20261
npm weekly downloads

516−115 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 2026516
Dec 5, 2026497
Dec 4, 2026371
Dec 3, 2026648
Dec 2, 2026633
Dec 1, 2026551
Nov 30, 2026549
Nov 29, 2026489
Nov 28, 2026538
Nov 27, 2026544
Nov 26, 2026278
Nov 25, 2026447
Nov 24, 2026427
Nov 23, 2026428
Nov 22, 2026442
Nov 21, 2026418
Nov 20, 2026517
Nov 19, 2026666
Nov 18, 2026603
Nov 17, 2026809
Nov 16, 2026871
Nov 15, 2026870
Nov 14, 2026848
Nov 13, 2026936
Nov 12, 2026915
Nov 11, 2026828
Nov 10, 2026636
Nov 9, 2026610
Nov 8, 2026593
Nov 7, 2026719
Nov 6, 2026586
Nov 5, 2026419
Nov 4, 2026403
Nov 3, 2026543
Nov 2, 2026506
Nov 1, 2026501
Oct 31, 2026356
Oct 30, 2026304
Oct 29, 2026284
Oct 28, 2026265
Oct 27, 2026151
Oct 26, 2026201
Oct 25, 2026223
Oct 24, 2026235
Oct 23, 2026186
Oct 22, 2026200
Oct 21, 2026267
Oct 20, 2026242
Oct 19, 2026207
Oct 18, 2026192
Oct 17, 2026171
Oct 16, 2026203
Oct 15, 2026244
Oct 14, 2026241
Oct 13, 2026274
Oct 12, 2026522
Oct 11, 2026612
Oct 10, 2026671
Oct 9, 2026729
Oct 8, 2026680
Oct 7, 2026663
Oct 6, 2026792
Oct 5, 2026694
Oct 4, 2026590
Oct 3, 2026541
Oct 2, 2026487
Oct 1, 2026546
Sep 30, 2026774
Sep 29, 2026648
Sep 28, 2026553
Sep 27, 2026669
Sep 26, 2026830
Sep 25, 20261,037
Sep 24, 20261,102
Sep 23, 2026940
Sep 22, 20261,178
Sep 21, 20261,175
Sep 20, 20261,105
Sep 19, 2026974
Sep 18, 2026766
Sep 17, 2026668
Sep 16, 2026616
Sep 15, 2026407
Sep 14, 2026402
Sep 13, 2026563
Sep 12, 2026584
Sep 11, 2026595
Sep 10, 2026638
Sep 9, 2026597
Sep 8, 2026551
Sep 7, 2026631

Each point is npm's rolling 7-day download count.

Health Score

67/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1320143736-root.svg)](https://payloaddirectory.dev/plugins/1320143736-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1320143736-root"><img src="https://payloaddirectory.dev/badge/1320143736-root.svg" alt="Payload Directory"></a>
Updated Dec 1, 2026Created Aug 2, 2026Published Nov 24, 2026

README

payload-passkey

This plugin adds passkey support to Payload CMS using Better Auth.

Although it is a wrapper around @delmaredigital/payload-better-auth, this plugin focuses specifically on passkeys. It preserves Payload's default login screen and uses Payload's UI components to match Payload's design language.

Screenshot of the login screen with a passkey login button

Screenshot of the account management screen with passkey management functionality

Features

  • Adds a passkey login button to Payload's login screen
  • Adds passkey management functionality to the account management screen
  • Supports automatic token refresh when enabled in the Payload configuration
  • Supports use alongside Payload TOTP
  • Supports passkey autofill
  • i18n support

Depending on the user's setup, they can log in using one of the following methods:

  • Users who do not use Payload TOTP, or who use Payload TOTP but have not configured TOTP: (email address AND password) OR passkey
  • Users who use Payload TOTP and have configured TOTP: (email address AND password AND TOTP) OR passkey

Installation

pnpm add payload-passkey

Basic Usage

# .env
BETTER_AUTH_SECRET=your-secret-key-longer-than-32-characters
// payload.config.ts
import { buildConfig } from "payload";
import { payloadPasskey } from "payload-passkey";

const config = buildConfig({
    collections: [
        {
            slug: "users",
            auth: true,
            fields: [...],
        },
    ],
    plugins: [
        payloadPasskey({
            rpID: "your-domain.example.com",
            rpName: "Example App",
            origin: "https://your-domain.example.com",
            modelName: "user",
            userCollection: "users",
            baseURL: "https://your-domain.example.com",
            secret: process.env.BETTER_AUTH_SECRET,
            trustedOrigins: ["https://your-domain.example.com"],
            generateId: "serial",
            firstUserAdmin: true,
            enablePasskeyAutofill: true
        })
    ]
});

export default config;

Once configured, run the database migrations. If you are using Payload's default authentication strategy, you do not need to update users' passwords; running the database migrations is sufficient.

npm run payload migrate:create
npm run payload migrate

Using with Payload TOTP

This plugin can also be used alongside Payload TOTP.

// payload.config.ts
import { buildConfig } from "payload";
import { payloadPasskey } from "payload-passkey";

const config = buildConfig({
    collections: [
        {
            slug: "users",
            auth: true,
            fields: [...],
        },
    ],
    plugins: [
        payloadPasskey({
            enableTotpCompatibility: true,
            rpID: "your-domain.example.com",
            rpName: "Example App",
            origin: "https://your-domain.example.com",
            modelName: "user",
            userCollection: "users",
            baseURL: "https://your-domain.example.com",
            secret: process.env.BETTER_AUTH_SECRET,
            trustedOrigins: ["https://your-domain.example.com"],
            generateId: "serial",
            firstUserAdmin: true,
            enablePasskeyAutofill: true
        }),
        // `payloadTotp()` must be called after `payloadPasskey()`;
        // otherwise, the collection generated by payload-passkey won't be protected by Payload TOTP.
        payloadTotp({
            collection: "users",
            totp: {
                issuer: "Example App"
            }
        })
    ]
});

export default config;

Once configured, run the database migrations. If you are using Payload's default authentication strategy, you do not need to update users' passwords; running the database migrations is sufficient.

npm run payload migrate:create
npm run payload migrate

Options

For all available options and their descriptions, see the documentation for PayloadPasskeyOptions.

Acknowledgements

This plugin is a wrapper around @delmaredigital/payload-better-auth and Better Auth. Some of the component code was based on @delmaredigital/payload-better-auth. The login button uses an icon from lucide-react.

@delmaredigital/payload-better-auth MIT License

Copyright (c) 2026 Delmare Digital

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

lucide-react ISC License

Copyright (c) 2026 Lucide Icons and Contributors

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Similar plugins