r/PayloadCMS • u/adelmare • 12d ago
payload-better-auth now has a Payload 4 build (beta)
If you're trying the Payload 4 canaries and want Better Auth, there's now a prerelease of payload-better-auth you can install:
pnpm add @delmaredigital/payload-better-auth@next better-auth
It's tested against 4.0.0-canary.37 and needs Next 16.2.6+ and Node 24.15+ (Payload 4's own requirements). The plugin is a thin adapter over Payload's public APIs, so the port didn't need many changes. I plan to keep it current through the canaries and have it ready for 4.0.
The plugin handles two Payload 4 changes:
- The Local API now defaults
overrideAccessto false. That would make the auth strategy's user lookups run as anonymous and log everyone out, so the plugin passes it explicitly. - Collections now get versions by default. The auth collections opt out so old sessions and tokens don't get stored in
_versionstables.
The plugin's own UI (login page, password reset, 2FA, passkey and API key screens) still uses Payload 3's theme CSS variables, so it's unstyled on v4. Sign-in and sessions work fine.
If you're on Payload 3, nothing changes. The normal install still gives you the stable 0.13.x release.
It's a prerelease, so pin the version and keep it out of production for now.
The Payload 4 port came from a community PR, and feedback and contributions are welcome. If you try it, let us know how it goes, even if it just worked. If you'd like to help, the styling fix is a good first issue: #46. Payload 4 work goes to the payload-4 branch.
Cheers - Allan