@clivly/auth-better-auth 0.7.0 → 0.7.2
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.
- package/README.md +21 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
# @clivly/auth-better-auth
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
better-auth implementation of Clivly's `ClivlyAuthAdapter`. It resolves the
|
|
4
|
+
current end-user through `auth.api.getSession({ headers })` on each request.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @clivly/auth-better-auth better-auth
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This adapter is a Tier 2 surface in
|
|
13
|
+
[STABILITY.md](https://github.com/amani-joseph/clivly.com/blob/master/STABILITY.md).
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
6
16
|
|
|
7
17
|
```ts
|
|
8
18
|
import { createBetterAuthAdapter } from "@clivly/auth-better-auth";
|
|
9
|
-
import { auth } from "./auth";
|
|
19
|
+
import { auth } from "./auth";
|
|
10
20
|
|
|
11
21
|
const authAdapter = createBetterAuthAdapter({ auth });
|
|
12
22
|
|
|
13
|
-
const user = await authAdapter.getUser(request);
|
|
23
|
+
const user = await authAdapter.getUser(request);
|
|
24
|
+
// { id, email, name } | null
|
|
14
25
|
```
|
|
15
26
|
|
|
16
|
-
|
|
27
|
+
The package does not bundle its own better-auth runtime. You pass your existing
|
|
28
|
+
`betterAuth({...})` instance in.
|
|
29
|
+
|
|
30
|
+
Returns `null` when there is no session, or when the session user cannot be
|
|
31
|
+
mapped to a Clivly user. The adapter only answers identity; CRM authorization
|
|
32
|
+
still lives in Clivly's separate `crm_members` layer.
|
|
17
33
|
|
|
18
34
|
## License
|
|
19
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clivly/auth-better-auth",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "better-auth implementation of Clivly's ClivlyAuthAdapter.",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@clivly/core": "0.7.
|
|
28
|
+
"@clivly/core": "0.7.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"tsdown": "^0.22.14",
|