<img src="https://github.com/b3nab/payload-better-auth/raw/v0.11.2/banner.png" alt="Banner">
You are one plugin away to revolutionize your PayloadCMS's auth.
<a href="https://payload-better-auth.abbenanti.com"><strong>Learn more »</strong></a>
<a href="https://payload-better-auth.abbenanti.com/docs">Docs</a>
·
<a href="https://github.com/b3nab/payload-better-auth/issues">Issues</a>
⚠️ ATTENTION: If you want a preview access to the plugin, you should contact the author (in private) and request access to the private registry.
A plugin that integrates Better Auth with Payload CMS v3, providing enhanced authentication capabilities. This plugin is thought to be used in production, with real users, so to be rock solid well tested and reliable. 🗿
The @b3nab/payload-better-auth plugin wraps the better-auth library to
seamleassly integrate advanced authentication features into Payload CMS v3. It
enhanches developer productivity and user experience by offering more
sophisticated authentication methods beyond Payload's built-in auth system.
Definitely it's a better-way 🤓 to manage authentication for Payload CMS v3.
While Payload CMS comes with a solid and extensible authentication system out of the box, it primarily focuses on basic email/password authentication and API keys. This serves many use cases well, but modern applications often require more sophisticated authentication methods and features.
The goal is to seamlessly integrate better-auth in your Payload CMS v3 application, providing a robust and feature-rich authentication system with a focus on user experience and developer productivity.
pnpm add @b3nab/payload-better-auth
Into your payload.config.ts file, add the plugin:
import { buildConfig } from "payload";
import { betterAuthPlugin } from "@b3nab/payload-better-auth";
export default buildConfig({
// ... other config
plugins: [
betterAuthPlugin({
// Better Auth Config. https://www.better-auth.com/docs/reference/options
betterAuth: {
// used by two factor plugin as an issuer and other things
appName: "My App",
// better-auth secret - you can omit it if your env variable is named `BETTER_AUTH_SECRET`
/** you can generate a good secret
* using the following command:
* @example
* openssl rand -base64 32
*/
secret: process.env.BETTER_AUTH_SECRET,
},
}),
],
// ... other config
});
git checkout -b feature/amazing-feature)git commit -m 'feat: add some amazing feature')git push origin feature/amazing-feature)Created and maintained by Benedetto Abbenanti.
This project would not be possible without the following open-source projects:
$ claude mcp add payload-better-auth \
-- python -m otcore.mcp_server <graph>