Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ZenStack Better-Auth Adapter

This package provides a database adapter for better-auth. It allows you to use ZenStack ORM as the database backend for better-auth.

Installation

npm install @zenstackhq/better-auth@next

Configuration

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.

npx @better-auth/cli generate