Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions packages/auth-adapters/better-auth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ZenStack Better-Auth Adapter

This package provides a database adapter for [better-auth](https://better-auth.com). It allows you to use ZenStack ORM as the database backend for better-auth.

## Installation

```bash
npm install @zenstackhq/better-auth@next
```

## Configuration

```ts
import { zenstackAdapter } from '@zenstackhq/better-auth';

// ZenStack ORM client
import { db } from './db';

const auth = new BetterAuth({
database: zenstackAdapter(db, {
provider: 'postgresql', // or 'sqlite'
}),
// other better-auth options...
});
```

## Schema generation

You can use the `@better-auth/cli` to populate better-auth's data models into your ZModel schema.

```bash
npx @better-auth/cli generate
```