@storyblok/react 2.0.17 → 2.0.18
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 +32 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -56,18 +56,15 @@ Install the file from the CDN:
|
|
|
56
56
|
### Initialization
|
|
57
57
|
|
|
58
58
|
Register the plugin on your application and add the [access token](https://www.storyblok.com/docs/api/content-delivery#topics/authentication?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-react) of your Storyblok space. You can also add the `apiPlugin` in case that you want to use the Storyblok API Client:
|
|
59
|
-
For Spaces created under `US` region, you should pass the region like `{ apiOptions: { region: 'us' } }`. If your space is under `EU`, no further configuration is required.
|
|
60
59
|
|
|
61
60
|
```js
|
|
62
61
|
import { storyblokInit, apiPlugin } from "@storyblok/react";
|
|
63
62
|
|
|
64
63
|
storyblokInit({
|
|
65
64
|
accessToken: "YOUR_ACCESS_TOKEN",
|
|
66
|
-
// bridge: false,
|
|
67
|
-
apiOptions: {
|
|
68
|
-
region: "us", // Pass this key/value if your space was created under US region
|
|
69
|
-
},
|
|
70
65
|
use: [apiPlugin],
|
|
66
|
+
// bridge: false,
|
|
67
|
+
// apiOptions: {},
|
|
71
68
|
components: {
|
|
72
69
|
page: Page,
|
|
73
70
|
teaser: Teaser,
|
|
@@ -83,6 +80,31 @@ That's it! All the features are enabled for you: the _Api Client_ for interactin
|
|
|
83
80
|
|
|
84
81
|
> You can enable/disable some of these features if you don't need them, so you save some KB. Please read the "Features and API" section
|
|
85
82
|
|
|
83
|
+
#### Region parameter
|
|
84
|
+
|
|
85
|
+
Possible values:
|
|
86
|
+
|
|
87
|
+
- `eu` (default): For spaces created in the EU
|
|
88
|
+
- `us`: For spaces created in the US
|
|
89
|
+
- `cn`: For spaces created in China
|
|
90
|
+
|
|
91
|
+
Full example for a space created in the US:
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
import { storyblokInit, apiPlugin } from "@storyblok/react";
|
|
95
|
+
|
|
96
|
+
storyblokInit({
|
|
97
|
+
accessToken: "YOUR_ACCESS_TOKEN",
|
|
98
|
+
use: [apiPlugin],
|
|
99
|
+
apiOptions: {
|
|
100
|
+
region: "us",
|
|
101
|
+
},
|
|
102
|
+
components: { },
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> Note: For spaces created in the United States or China, the `region` parameter **must** be specified.
|
|
107
|
+
|
|
86
108
|
### Getting Started
|
|
87
109
|
|
|
88
110
|
`@storyblok/react` does three actions when you initialize it:
|
|
@@ -304,6 +326,11 @@ renderRichText(blok.richTextField, {
|
|
|
304
326
|
});
|
|
305
327
|
```
|
|
306
328
|
|
|
329
|
+
## The Storyblok JavaScript SDK Ecosystem
|
|
330
|
+
|
|
331
|
+

|
|
332
|
+
|
|
333
|
+
|
|
307
334
|
## 🔗 Related Links
|
|
308
335
|
|
|
309
336
|
- **[Storyblok Technology Hub](https://www.storyblok.com/technologies?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-react)**: Storyblok integrates with every framework so that you are free to choose the best fit for your project. We prepared the technology hub so that you can find selected beginner tutorials, videos, boilerplates, and even cheatsheets all in one place.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18",
|
|
4
4
|
"description": "SDK to integrate Storyblok into your project using React.",
|
|
5
5
|
"main": "./dist/storyblok-react.js",
|
|
6
6
|
"module": "./dist/storyblok-react.mjs",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"@storyblok/js": "^2.1.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/core": "^7.21.
|
|
31
|
-
"@babel/preset-env": "^7.
|
|
30
|
+
"@babel/core": "^7.21.4",
|
|
31
|
+
"@babel/preset-env": "^7.21.4",
|
|
32
32
|
"@cypress/react": "^5.12.5",
|
|
33
33
|
"@cypress/vite-dev-server": "^2.2.3",
|
|
34
34
|
"@tsconfig/recommended": "^1.0.2",
|
|
35
|
-
"@types/react": "18.0
|
|
35
|
+
"@types/react": "18.2.0",
|
|
36
36
|
"@vitejs/plugin-react": "^1.3.2",
|
|
37
37
|
"babel-jest": "^29.5.0",
|
|
38
38
|
"cypress": "^9.7.0",
|