Security management
The two-factor, passkey and API key management screens the plugin adds to the admin, and what turns each one on.
The plugin adds management UI for the Better Auth plugins you enable. Two-factor and passkeys are per-user settings, so they appear on the user's own document. API keys are an admin-level feature, so they get their own view and sidebar link.
| UI | Where it appears | Requires |
|---|---|---|
| Two-factor authentication | A field on the auth collection's edit view | twoFactor() |
| Passkeys | A field on the auth collection's edit view | passkey() from @better-auth/passkey |
| API keys | Admin view at /admin/security/api-keys, linked in the sidebar | apiKey() from @better-auth/api-key |
Turning it on
The plugin detects enabled Better Auth plugins from admin.betterAuthOptions. Pass the same options you give betterAuth():
createBetterAuthPlugin({
createAuth,
admin: {
betterAuthOptions,
},
})Without admin.betterAuthOptions, no management UI is added.
admin.enableManagementUI: falseturns all of it off (defaulttrue).admin.managementPaths.apiKeysmoves the API keys view (default'/security/api-keys').admin.apiKeyconfigures which collections appear in the permission picker and who may manage keys. See API keys.
Building your own
The pieces are exported for custom screens:
| Export | From |
|---|---|
TwoFactorManagementClient, SecurityNavLinks | @delmaredigital/payload-better-auth/components/management |
TwoFactorView, TwoFactorSetupViewWrapper | @delmaredigital/payload-better-auth/rsc |
PasskeysManagementClient, PasskeysField | @delmaredigital/payload-better-auth/components/passkey |
PasskeysView | @delmaredigital/payload-better-auth/rsc/passkey |
ApiKeysManagementClient | @delmaredigital/payload-better-auth/components/api-key |
ApiKeysView | @delmaredigital/payload-better-auth/rsc/api-key |
TwoFactorField | @delmaredigital/payload-better-auth/components |
detectEnabledPlugins | @delmaredigital/payload-better-auth/management |
Social sign-in
Show "Continue with …" buttons for Better Auth social and generic OAuth/OIDC providers on the admin login, and control who gets a user row.
payloadAdapter
The Better Auth database adapter that stores auth data in Payload collections. Options, ID and database detection, and custom model names.

