
Strapi Plugin Boilerplate
A production-ready starter template for building Strapi v5 plugins. Clone this repo, rename the plugin, and start building — the development environment, test infrastructure, linting, and CI pipeline are already wired up.

A Better Auth database adapter that uses Strapi as the database backend
released November 17, 2026
npm install @strapi-community/plugin-better-authA Better Auth database adapter that uses Strapi as the database backend. This package allows you to integrate Better Auth's authentication system with your Strapi application seamlessly.
You need to be running Strapi 5.45.0 or higher to use this plugin.
npm install better-auth @strapi-community/plugin-better-auth
# or
yarn add better-auth @strapi-community/plugin-better-auth
# or
pnpm add better-auth @strapi-community/plugin-better-authCreate the Better Auth config file and add the following content.
// src/lib/auth.ts
import { betterAuth } from "better-auth";
import { strapiAdapter } from '@strapi-community/plugin-better-auth';
export const auth = betterAuth({
database: strapiAdapter(),
trustedOrigins: ['http://localhost:3000'],
advanced: {
database: {
generateId: 'serial',
},
},
});Run the content type generation command to bootstrap the default content types.
npx auth generateTip: Every time you install a new Better Auth plugin, you have to run this command again.
Call the Better Auth API from your front-end:
// In your React/Vue/Svelte app
import { createAuthClient } from 'better-auth/react'; // or /vue, /svelte
const authClient = createAuthClient({
baseURL: 'http://localhost:1337/api/auth',
});
// Sign up
await authClient.signUp.email({
email: 'user@example.com',
password: 'password123',
name: 'John Doe',
});Use the Better Auth session to authenticate your users in custom Strapi controllers.
import { auth } from '@/lib/auth.ts';
// In a Strapi controller
export default {
async customMethod(ctx) {
// Use Better Auth API methods
const session = await auth.api.getSession({
headers: ctx.request.headers,
});
if (session) {
// User is authenticated
console.log('User:', session.user);
}
}
}Any Better Auth plugin may be used with Strapi + Better Auth. Some plugins require you to run the generate CLI in order to make the required schema changes. To do that you have to manually specify the location of the Better Auth config file.
npx auth generateSee the LICENSE file for licensing information.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
