@zenstackhq/better-auth 3.0.0-beta.24 → 3.0.0-beta.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -0
  2. package/package.json +7 -7
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # ZenStack Better-Auth Adapter
2
+
3
+ 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.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @zenstackhq/better-auth@next
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ ```ts
14
+ import { zenstackAdapter } from '@zenstackhq/better-auth';
15
+
16
+ // ZenStack ORM client
17
+ import { db } from './db';
18
+
19
+ const auth = new BetterAuth({
20
+ database: zenstackAdapter(db, {
21
+ provider: 'postgresql', // or 'sqlite'
22
+ }),
23
+ // other better-auth options...
24
+ });
25
+ ```
26
+
27
+ ## Schema generation
28
+
29
+ You can use the `@better-auth/cli` to populate better-auth's data models into your ZModel schema.
30
+
31
+ ```bash
32
+ npx @better-auth/cli generate
33
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenstackhq/better-auth",
3
- "version": "3.0.0-beta.24",
3
+ "version": "3.0.0-beta.25",
4
4
  "description": "ZenStack Better Auth Adapter. This adapter is modified from better-auth's Prisma adapter.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -30,9 +30,9 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "ts-pattern": "^5.7.1",
33
- "@zenstackhq/orm": "3.0.0-beta.24",
34
- "@zenstackhq/common-helpers": "3.0.0-beta.24",
35
- "@zenstackhq/language": "3.0.0-beta.24"
33
+ "@zenstackhq/orm": "3.0.0-beta.25",
34
+ "@zenstackhq/language": "3.0.0-beta.25",
35
+ "@zenstackhq/common-helpers": "3.0.0-beta.25"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@better-auth/core": "^1.3.0",
@@ -41,9 +41,9 @@
41
41
  "devDependencies": {
42
42
  "@better-auth/core": "^1.3.0",
43
43
  "better-auth": "^1.3.0",
44
- "@zenstackhq/eslint-config": "3.0.0-beta.24",
45
- "@zenstackhq/typescript-config": "3.0.0-beta.24",
46
- "@zenstackhq/vitest-config": "3.0.0-beta.24"
44
+ "@zenstackhq/eslint-config": "3.0.0-beta.25",
45
+ "@zenstackhq/typescript-config": "3.0.0-beta.25",
46
+ "@zenstackhq/vitest-config": "3.0.0-beta.25"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsc --noEmit && tsup-node",