@okendo/shopify-hydrogen 0.0.1

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 (3) hide show
  1. package/README.md +44 -0
  2. package/package.json +36 -0
  3. package/plugin.js +1 -0
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Okendo Hydrogen React Components #
2
+
3
+ This is the React component library to support Okendo Widget Plus Widgets in Shopify Hydrogen Projects.
4
+
5
+ Currently we support server side components for 2 widgets:
6
+ 1. Reviews List
7
+ 2. Star Ratings
8
+
9
+ This includes:
10
+ ## OkendoProvider.server ##
11
+ This retrieves the Widget Plus configuration from our public API.
12
+
13
+ This should wrap as high up in the React component tree as possible.
14
+
15
+ In the sample Shopify Hydrogen project in `App.server.jsx` we include it as the first child of `<ShopifyProvider>`.
16
+
17
+ The final server side render/output includes:
18
+ * Okendo Subscriber Settings JSON
19
+ * Widget Pre-Render Style Tags Metafield - This is the "Above the fold" CSS essential for rendering SSR'd Okendo Reviews Widget (first page) and Star Ratings - This ensures styled widgets before client-side hydration occurs.
20
+ * Base CSS Vars
21
+ * Any custom CSS specified in the Okendo Admin.
22
+
23
+ ## OkendoStarRating.server ##
24
+ This is the server-side rendered Star Rating widget - It then invokes the client side `OkendoWidget.client.tsx` component to perform client side hydration.
25
+
26
+ ## OkendoReviewsWidget.server ##
27
+ This is the server-side rendered Reviews List widget - It then invokes the client side `OkendoWidget.client.tsx` component to perform client side hydration.
28
+
29
+
30
+ ### How do I use this in my Shopify Hydrogen project? ###
31
+ * Your Shopify Hydrogen app will require the following variables added to your `.env` file:
32
+ ** `VITE_STORE_DOMAIN`: Your myshopify.com URL
33
+ ** `VITE_SHOPIFY_STOREFRONT_TOKEN`: Your Shopify App Storefront Token - See: https://shopify.dev/api/examples/storefront-api
34
+ ** `VITE_OKENDO_SUBSCRIBER_ID`: Your Okendo Subscriber ID - Issued by Okendo
35
+ ** `VITE_OKENDO_API_DOMAIN`: The Okendo api domain this will override the default production domain if supplied: api.okendo.io
36
+ ** `VITE_OKENDO_CDN`: The Okendo CDN domain - This will override the default production domain if supplied: cdn.okendo.io
37
+
38
+ * TODO - Ideally we point to a sample hydrogen project using our widgets.
39
+
40
+
41
+ ### Who do I talk to? ###
42
+
43
+ * Tom Fulcher - tom.fulcher@okendo.io, Susanne Peng - susanne.peng@okendo.io, Rowan Puckeridge - rowan.puckeridge@okendo.io
44
+ * Okendo Widget Pod
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@okendo/shopify-hydrogen",
3
+ "version": "0.0.1",
4
+ "description": "A component library containing Okendo Reviews Widget componenets.",
5
+ "main": "dist/esnext/index.js",
6
+ "files": [
7
+ "dist",
8
+ "plugin.js"
9
+ ],
10
+ "scripts": {
11
+ "build": "rimraf dist/ && npm run build:plugin:cjs && npm run build:esm",
12
+ "build:plugin:cjs": "tsc --p tsconfig.plugin.cjs.json",
13
+ "build:esm": "tsc --p tsconfig.esm.json"
14
+ },
15
+ "author": "Okendo",
16
+ "license": "ISC",
17
+ "dependencies": {
18
+ "@okendo/reviews-common": "^4.157.0",
19
+ "html-react-parser": "^1.4.13"
20
+ },
21
+ "devDependencies": {
22
+ "@okendo/reviews-widget-plus": "^0.39.0",
23
+ "@okendo/tsconfig": "0.0.2",
24
+ "@shopify/hydrogen": "^0.22.1",
25
+ "@types/node": "^17.0.35",
26
+ "@types/react": "^18.0.9",
27
+ "@types/react-dom": "^18.0.5",
28
+ "dotenv": "^16.0.1",
29
+ "rimraf": "^3.0.2",
30
+ "typescript": "^4.7.2",
31
+ "vite": "^2.9.0"
32
+ },
33
+ "peerDependencies": {
34
+ "@shopify/hydrogen": "0.22.x"
35
+ }
36
+ }
package/plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/node/plugin');