@ninetailed/experience.js-gatsby 1.7.2-beta.1 → 1.7.2
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 +30 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -72,6 +72,32 @@ By using the gatsby plugin there's no need to configure the `NinetailedProvuder`
|
|
|
72
72
|
|
|
73
73
|
The plugin automatically tracks Pageviews on route change, please do not track it on your own as you would duplicate events.
|
|
74
74
|
|
|
75
|
+
### Ninetailed Plugins
|
|
76
|
+
|
|
77
|
+
To use Ninetailed Plugins like `@ninetailed/experience.js-plugin-preview` you have to pass them to the plugins array of the `@ninetailed/experience.js-gatsby` SDK.
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
plugins: [
|
|
81
|
+
...your other gatsby plugins
|
|
82
|
+
{
|
|
83
|
+
resolve: `@ninetailed/experience.js-gatsby`,
|
|
84
|
+
options: {
|
|
85
|
+
clientId: 'your api key',
|
|
86
|
+
ninetailedPlugins: [
|
|
87
|
+
{
|
|
88
|
+
resolve: `@ninetailed/experience.js-plugin-preview`,
|
|
89
|
+
// These options are the args of the plugin itself
|
|
90
|
+
options: {
|
|
91
|
+
clientId: "a readlony api token id",
|
|
92
|
+
secret: "a readlony token secret"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
```
|
|
100
|
+
|
|
75
101
|
## Personalizing Components
|
|
76
102
|
|
|
77
103
|
### Personalize Component
|
|
@@ -80,7 +106,7 @@ To make personalizing your components as seamless as possible Ninetailed provide
|
|
|
80
106
|
|
|
81
107
|
```TypeScript
|
|
82
108
|
import React from 'react';
|
|
83
|
-
import { Personalize } from '@ninetailed/experience.js-
|
|
109
|
+
import { Personalize } from '@ninetailed/experience.js-react';
|
|
84
110
|
|
|
85
111
|
type HeadlineProps = {
|
|
86
112
|
text: string;
|
|
@@ -114,7 +140,7 @@ Using the visitor's and the useProfile hook makes it very easy to use inline per
|
|
|
114
140
|
|
|
115
141
|
```TypeScript
|
|
116
142
|
import React, { useState, useEffect } from 'react';
|
|
117
|
-
import { useProfile } from '@ninetailed/experience.js-
|
|
143
|
+
import { useProfile } from '@ninetailed/experience.js-react';
|
|
118
144
|
|
|
119
145
|
const Greeting = () => {
|
|
120
146
|
const [loading, profile, error] = useProfile();
|
|
@@ -138,12 +164,13 @@ import {
|
|
|
138
164
|
RenderRichTextData,
|
|
139
165
|
ContentfulRichTextGatsbyReference,
|
|
140
166
|
} from 'gatsby-source-contentful/rich-text';
|
|
141
|
-
import { MergeTag } from '@ninetailed/experience.js-
|
|
167
|
+
import { MergeTag } from '@ninetailed/experience.js-react';
|
|
142
168
|
|
|
143
169
|
const options = {
|
|
144
170
|
renderNode: {
|
|
145
171
|
[INLINES.EMBEDDED_ENTRY]: (node) => {
|
|
146
172
|
const id = node.data.target.id;
|
|
173
|
+
// The __typename changes depending on your Contentful setup.
|
|
147
174
|
if (node.data.target.__typename === "ContentfulNtMergeTag" && id) {
|
|
148
175
|
return <MergeTag id={mergeTag.id} />;
|
|
149
176
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-gatsby",
|
|
3
|
-
"version": "1.7.2
|
|
4
|
-
"main": "index.js",
|
|
3
|
+
"version": "1.7.2",
|
|
5
4
|
"keywords": [
|
|
6
5
|
"gatsby",
|
|
7
6
|
"gatsby-plugin",
|
|
@@ -15,14 +14,15 @@
|
|
|
15
14
|
"react": ">=16.8.0",
|
|
16
15
|
"gatsby": ">=2.27.4"
|
|
17
16
|
},
|
|
18
|
-
"
|
|
17
|
+
"main": "./index.js",
|
|
18
|
+
"typings": "./index.d.ts",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ninetailed/experience.js-react": "1.7.2
|
|
20
|
+
"@ninetailed/experience.js-react": "1.7.2",
|
|
21
21
|
"@analytics/google-analytics": "^0.5.3",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
|
-
"@ninetailed/experience.js": "1.7.2
|
|
23
|
+
"@ninetailed/experience.js": "1.7.2",
|
|
24
24
|
"analytics": "^0.8.0",
|
|
25
|
-
"@ninetailed/experience.js-shared": "1.7.2
|
|
25
|
+
"@ninetailed/experience.js-shared": "1.7.2",
|
|
26
26
|
"uuid": "^8.3.2",
|
|
27
27
|
"ts-toolbelt": "^9.6.0",
|
|
28
28
|
"locale-enum": "^1.1.1",
|