@youversion/platform-react-hooks 0.5.6 → 0.5.7
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +8 -0
- package/README.md +18 -23
- package/package.json +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @youversion/platform-react-hooks@0.5.
|
|
2
|
+
> @youversion/platform-react-hooks@0.5.7 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/hooks
|
|
3
3
|
> tsc -p tsconfig.build.json
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ React hooks for accessing YouVersion Platform APIs with automatic loading/error
|
|
|
6
6
|
|
|
7
7
|
## When to use this package
|
|
8
8
|
|
|
9
|
-
Use `@youversion/platform-react-hooks` when you need:
|
|
10
|
-
- ✅
|
|
11
|
-
- ✅
|
|
12
|
-
- ✅
|
|
13
|
-
- ✅
|
|
9
|
+
Use `@youversion/platform-react-hooks` when you need to:
|
|
10
|
+
- ✅ Build custom React components with Bible features
|
|
11
|
+
- ✅ Fetch data declaratively with automatic loading/error states
|
|
12
|
+
- ✅ Keep control over component UI while leveraging reusable hooks
|
|
13
|
+
- ✅ Support server-side rendering compatible hooks
|
|
14
14
|
|
|
15
|
-
**Use other packages instead if:**
|
|
15
|
+
**Use other packages instead if you:**
|
|
16
16
|
- ❌ Need direct API access → Use [@youversion/platform-core](../core/README.md) for low-level client
|
|
17
17
|
- ❌ Want ready-made UI → Use [@youversion/platform-react-ui](../ui/README.md) for production components
|
|
18
18
|
|
|
@@ -26,24 +26,13 @@ Get your App Key at [platform.youversion.com](https://platform.youversion.com/)
|
|
|
26
26
|
|
|
27
27
|
## Usage
|
|
28
28
|
|
|
29
|
-
Wrap your app with `BibleSDKProvider`:
|
|
30
|
-
|
|
31
29
|
```tsx
|
|
32
|
-
import { BibleSDKProvider,
|
|
30
|
+
import { BibleSDKProvider, usePassage } from '@youversion/platform-react-hooks';
|
|
33
31
|
|
|
34
32
|
function BibleVerse() {
|
|
35
|
-
const {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (versionLoading || passageLoading) return <div>Loading...</div>;
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div>
|
|
42
|
-
<h1>{passage?.human_reference}</h1>
|
|
43
|
-
<p>Version: {version?.abbreviation}</p>
|
|
44
|
-
<div dangerouslySetInnerHTML={{ __html: passage?.content || '' }} />
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
33
|
+
const { passage, loading } = usePassage({ versionId: 111, usfm: 'JHN.3.16' });
|
|
34
|
+
if (loading) return <div>Loading...</div>;
|
|
35
|
+
return <div dangerouslySetInnerHTML={{ __html: passage?.content || '' }} />;
|
|
47
36
|
}
|
|
48
37
|
|
|
49
38
|
function App() {
|
|
@@ -55,6 +44,12 @@ function App() {
|
|
|
55
44
|
}
|
|
56
45
|
```
|
|
57
46
|
|
|
58
|
-
|
|
47
|
+
## Documentation and API Reference
|
|
48
|
+
* [developers.youversion.com/sdks/react](https://developers.youversion.com/sdks/react)
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
This SDK is licensed under [Apache 2.0](./LICENSE).
|
|
59
53
|
|
|
60
|
-
|
|
54
|
+
Licensing information for the Bible versions is available
|
|
55
|
+
at the [YouVersion Platform](https://platform.youversion.com/) site.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youversion/platform-react-hooks",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@youversion/platform-core": "0.5.
|
|
25
|
+
"@youversion/platform-core": "0.5.7"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=19.1.0 <20.0.0"
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"eslint": "9.38.0",
|
|
37
37
|
"typescript": "5.9.3",
|
|
38
38
|
"vitest": "4.0.4",
|
|
39
|
-
"@internal/
|
|
40
|
-
"@internal/
|
|
39
|
+
"@internal/eslint-config": "0.0.0",
|
|
40
|
+
"@internal/tsconfig": "0.0.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "tsc --watch",
|