@clivly/auth-clerk 0.7.1 → 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 +19 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# @clivly/auth-clerk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Clerk implementation of Clivly's `ClivlyAuthAdapter`. It resolves the current
|
|
4
|
+
end-user from the host app's Clerk session and returns a Clivly-compatible user
|
|
5
|
+
shape.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
> The email mapper and session resolution are unit-tested; broader host-app
|
|
7
|
-
> compatibility coverage is still growing.
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npm install @clivly/auth-clerk @clerk/backend
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This adapter is a Tier 2 surface in
|
|
14
|
+
[STABILITY.md](https://github.com/amani-joseph/clivly.com/blob/master/STABILITY.md).
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
10
17
|
|
|
11
18
|
```ts
|
|
12
19
|
import { createClerkAuthAdapter } from "@clivly/auth-clerk";
|
|
@@ -14,11 +21,17 @@ import { createClerkAuthAdapter } from "@clivly/auth-clerk";
|
|
|
14
21
|
const authAdapter = createClerkAuthAdapter({
|
|
15
22
|
secretKey: process.env.CLERK_SECRET_KEY!,
|
|
16
23
|
publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
|
|
24
|
+
// optional:
|
|
25
|
+
// authorizedParties: ["https://app.example.com"],
|
|
17
26
|
});
|
|
18
27
|
|
|
19
|
-
const user = await authAdapter.getUser(request);
|
|
28
|
+
const user = await authAdapter.getUser(request);
|
|
29
|
+
// { id, email, name } | null
|
|
20
30
|
```
|
|
21
31
|
|
|
32
|
+
Returns `null` when no Clerk session resolves, or when the resolved Clerk user
|
|
33
|
+
does not map to a Clivly user.
|
|
34
|
+
|
|
22
35
|
## License
|
|
23
36
|
|
|
24
37
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clivly/auth-clerk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Clerk 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
|
"peerDependencies": {
|
|
31
31
|
"@clerk/backend": ">=1"
|