jazz-browser-auth-clerk 0.8.21 → 0.8.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +39 -3
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # jazz-browser-media-images
2
2
 
3
+ ## 0.8.23
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6f745be]
8
+ - Updated dependencies [d348c2d]
9
+ - Updated dependencies [124bf67]
10
+ - Updated dependencies [e442bb8]
11
+ - Updated dependencies [6902b5b]
12
+ - Updated dependencies [1a0cd3d]
13
+ - cojson@0.8.23
14
+ - jazz-tools@0.8.23
15
+ - jazz-browser@0.8.23
16
+
17
+ ## 0.8.22
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [f6bc8af]
22
+ - jazz-browser@0.8.22
23
+
3
24
  ## 0.8.21
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -1,5 +1,41 @@
1
- # `jazz-browser-media-images`
1
+ # `jazz-browser-auth-clerk`
2
2
 
3
- This is an optional add-on for `jazz-browser` or `jazz-react` that provides support for creating `ImageDefinition`-compatible image sets from images provided as `File` or `Blob` objects.
3
+ This package provides a [Clerk-based](https://clerk.com/) authentication strategy for Jazz.
4
4
 
5
- In particular, it implements multi-resolution resizing based on `pica`.
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.21",
3
+ "version": "0.8.23",
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.21",
10
- "jazz-browser": "0.8.21",
11
- "jazz-tools": "0.8.21"
9
+ "cojson": "0.8.23",
10
+ "jazz-browser": "0.8.23",
11
+ "jazz-tools": "0.8.23"
12
12
  },
13
13
  "devDependencies": {
14
14
  "typescript": "^5.3.3"