@fencyai/react 0.1.140 → 0.1.142

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 +22 -5
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,11 +1,28 @@
1
1
  # `@fencyai/react`
2
2
 
3
- > TODO: description
3
+ The official React SDK for [Fency.ai](https://fency.ai).
4
4
 
5
- ## Usage
5
+ For more information, visit [docs.fency.ai](https://docs.fency.ai).
6
6
 
7
- ```
8
- const react = require('@fencyai/react');
7
+ ## Setup
8
+
9
+ ```tsx
10
+ import { loadFency } from '@fencyai/js'
11
+ import { FencyProvider } from '@fencyai/react'
12
+
13
+ const fency = loadFency({ publishableKey: 'pk_your_publishable_key' })
9
14
 
10
- // TODO: DEMONSTRATE API
15
+ export default function App() {
16
+ return (
17
+ <FencyProvider
18
+ fency={fency}
19
+ fetchCreateStreamClientToken={async () => {
20
+ const res = await fetch('/api/fency-token')
21
+ return res.json()
22
+ }}
23
+ >
24
+ {/* your app */}
25
+ </FencyProvider>
26
+ )
27
+ }
11
28
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fencyai/react",
3
- "version": "0.1.140",
3
+ "version": "0.1.142",
4
4
  "description": "> TODO: description",
5
5
  "author": "staklau <steinaageklaussen@gmail.com>",
6
6
  "homepage": "",
@@ -37,14 +37,14 @@
37
37
  "@microsoft/fetch-event-source": "^2.0.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@fencyai/js": "^0.1.140",
40
+ "@fencyai/js": "^0.1.142",
41
41
  "@testing-library/react": "^16.3.2",
42
- "@types/jest": "^29.5.11",
42
+ "@types/jest": "^30.0.0",
43
43
  "@types/node": "^20.10.5",
44
44
  "@types/react": "^18.2.45",
45
45
  "@types/react-syntax-highlighter": "^15.5.13",
46
46
  "@vitejs/plugin-react": "^4.3.4",
47
- "jest": "^29.7.0",
47
+ "jest": "^30.0.0",
48
48
  "jest-environment-jsdom": "^30.2.0",
49
49
  "ts-jest": "^29.1.1",
50
50
  "typescript": "^5.3.3",
@@ -53,7 +53,7 @@
53
53
  "vite-plugin-lib-inject-css": "^2.1.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@fencyai/js": "^0.1.140",
56
+ "@fencyai/js": "^0.1.142",
57
57
  "motion": "^11.15.0",
58
58
  "react": ">=16.8.0",
59
59
  "react-markdown": "^10.1.0",
@@ -66,5 +66,5 @@
66
66
  "optional": false
67
67
  }
68
68
  },
69
- "gitHead": "be7118dcbb94d5ea40aed3f595c65ae8b06f1930"
69
+ "gitHead": "d8878df9dc28dfbaa24d586dfb7b60d213f1b0ef"
70
70
  }