@linchkit/cap-auth-better-auth
v1.0.0
Published
Better Auth provider for LinchKit authentication — concrete `AuthProvider` implementation using [better-auth](https://www.better-auth.com/) as the authentication engine. Recommended for production use.
Downloads
195
Readme
@linchkit/cap-auth-better-auth
Better Auth provider for LinchKit authentication — concrete AuthProvider implementation using better-auth as the authentication engine. Recommended for production use.
Installation
bun add @linchkit/cap-auth-better-authPeer Dependencies
@linchkit/core^0.1.0@linchkit/cap-auth^0.1.0drizzle-orm>=0.41.0
Usage
import { createCapAuth } from "@linchkit/cap-auth";
import { createBetterAuthProvider } from "@linchkit/cap-auth-better-auth";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
const db = drizzle(postgres(process.env.DATABASE_URL!));
const capAuth = createCapAuth({
provider: createBetterAuthProvider({ database: db }),
});Seed System Admin
import { seedSystemAdmin } from "@linchkit/cap-auth-better-auth";
await seedSystemAdmin({
email: "[email protected]",
password: "secure-password",
});