jazz-browser-auth-clerk 0.8.22 → 0.8.24
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/README.md +39 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# jazz-browser-media-images
|
2
2
|
|
3
|
+
## 0.8.24
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- jazz-browser@0.8.24
|
8
|
+
|
9
|
+
## 0.8.23
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- Updated dependencies [6f745be]
|
14
|
+
- Updated dependencies [d348c2d]
|
15
|
+
- Updated dependencies [124bf67]
|
16
|
+
- Updated dependencies [e442bb8]
|
17
|
+
- Updated dependencies [6902b5b]
|
18
|
+
- Updated dependencies [1a0cd3d]
|
19
|
+
- cojson@0.8.23
|
20
|
+
- jazz-tools@0.8.23
|
21
|
+
- jazz-browser@0.8.23
|
22
|
+
|
3
23
|
## 0.8.22
|
4
24
|
|
5
25
|
### Patch Changes
|
package/README.md
CHANGED
@@ -1,5 +1,41 @@
|
|
1
|
-
# `jazz-browser-
|
1
|
+
# `jazz-browser-auth-clerk`
|
2
2
|
|
3
|
-
This
|
3
|
+
This package provides a [Clerk-based](https://clerk.com/) authentication strategy for Jazz.
|
4
4
|
|
5
|
-
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
`useJazzClerkAuth` is a hook that returns a `JazzAuth` object and a `JazzAuthState` object. Provide a Clerk instance to `useJazzClerkAuth`, and it will return the appropriate `JazzAuth` object. Once authenticated, authentication will persist across page reloads, even if the device is offline.
|
8
|
+
|
9
|
+
|
10
|
+
From [the example chat app](https://github.com/gardencmp/jazz/tree/main/examples/chat-clerk):
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
import { ClerkProvider, SignInButton, useClerk } from "@clerk/clerk-react";
|
14
|
+
import { useJazzClerkAuth } from "jazz-react-auth-clerk";
|
15
|
+
|
16
|
+
const Jazz = createJazzReactApp();
|
17
|
+
export const { useAccount, useCoState } = Jazz;
|
18
|
+
|
19
|
+
function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
20
|
+
const clerk = useClerk();
|
21
|
+
const [auth, state] = useJazzClerkAuth(clerk);
|
22
|
+
|
23
|
+
return (
|
24
|
+
<>
|
25
|
+
{state.errors.map((error) => (
|
26
|
+
<div key={error}>{error}</div>
|
27
|
+
))}
|
28
|
+
{auth ? (
|
29
|
+
<Jazz.Provider
|
30
|
+
auth={auth}
|
31
|
+
peer="wss://cloud.jazz.tools/?key=chat-example-jazz-clerk@gcmp.io"
|
32
|
+
>
|
33
|
+
{children}
|
34
|
+
</Jazz.Provider>
|
35
|
+
) : (
|
36
|
+
<SignInButton />
|
37
|
+
)}
|
38
|
+
</>
|
39
|
+
);
|
40
|
+
}
|
41
|
+
```
|
package/package.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "jazz-browser-auth-clerk",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.24",
|
4
4
|
"type": "module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "src/index.ts",
|
7
7
|
"license": "MIT",
|
8
8
|
"dependencies": {
|
9
|
-
"cojson": "0.8.
|
10
|
-
"jazz-browser": "0.8.
|
11
|
-
"jazz-tools": "0.8.
|
9
|
+
"cojson": "0.8.23",
|
10
|
+
"jazz-browser": "0.8.24",
|
11
|
+
"jazz-tools": "0.8.23"
|
12
12
|
},
|
13
13
|
"devDependencies": {
|
14
14
|
"typescript": "^5.3.3"
|