@go1/go1-embedding-react-sdk 0.0.37 → 0.0.38
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 +3 -3
- package/dist/README.md +3 -3
- package/dist/common/types.d.ts +3 -0
- package/dist/go1-embedding-react-sdk/src/index.js +13 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -158,7 +158,6 @@ export type FeatureType =
|
|
|
158
158
|
export interface InitOptions {
|
|
159
159
|
/** Mandatory identifier for the embedded feature */
|
|
160
160
|
feature: FeatureType;
|
|
161
|
-
// eslint-disable-next-line max-len
|
|
162
161
|
/** Optional element id to search for, and use as the parent for the Go1 content view (use either this or `iframeParentElement`, not both) */
|
|
163
162
|
iframeParentId?: string;
|
|
164
163
|
/** Optional element to use as the parent for the Go1 content view (use either this or `iframeParentId`, not both) */
|
|
@@ -169,15 +168,16 @@ export interface InitOptions {
|
|
|
169
168
|
portalURL?: string;
|
|
170
169
|
/** Optional function that is invoked when the Go1 content view emits a message */
|
|
171
170
|
onGo1MessageReceived?: OnGo1MessageReceived;
|
|
172
|
-
// eslint-disable-next-line max-len
|
|
173
171
|
/** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
|
|
174
172
|
additionalUserInfo?: AdditionalUserInfo;
|
|
175
173
|
/** Optional UI configuration */
|
|
176
174
|
themeInformation?: ThemeInformation;
|
|
177
175
|
/** Optional token that is used to pre-authorize the user without them needing to log in */
|
|
178
176
|
oneTimeToken?: string;
|
|
179
|
-
/** Optional Id that let us know users are coming from
|
|
177
|
+
/** Optional Id that let us know which integration system users are coming from (will be required in the future)*/
|
|
180
178
|
integrationSystemId?: string;
|
|
179
|
+
/** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
|
|
180
|
+
presentingIntegrationSystemId?: string;
|
|
181
181
|
}
|
|
182
182
|
```
|
|
183
183
|
|
package/dist/README.md
CHANGED
|
@@ -158,7 +158,6 @@ export type FeatureType =
|
|
|
158
158
|
export interface InitOptions {
|
|
159
159
|
/** Mandatory identifier for the embedded feature */
|
|
160
160
|
feature: FeatureType;
|
|
161
|
-
// eslint-disable-next-line max-len
|
|
162
161
|
/** Optional element id to search for, and use as the parent for the Go1 content view (use either this or `iframeParentElement`, not both) */
|
|
163
162
|
iframeParentId?: string;
|
|
164
163
|
/** Optional element to use as the parent for the Go1 content view (use either this or `iframeParentId`, not both) */
|
|
@@ -169,15 +168,16 @@ export interface InitOptions {
|
|
|
169
168
|
portalURL?: string;
|
|
170
169
|
/** Optional function that is invoked when the Go1 content view emits a message */
|
|
171
170
|
onGo1MessageReceived?: OnGo1MessageReceived;
|
|
172
|
-
// eslint-disable-next-line max-len
|
|
173
171
|
/** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
|
|
174
172
|
additionalUserInfo?: AdditionalUserInfo;
|
|
175
173
|
/** Optional UI configuration */
|
|
176
174
|
themeInformation?: ThemeInformation;
|
|
177
175
|
/** Optional token that is used to pre-authorize the user without them needing to log in */
|
|
178
176
|
oneTimeToken?: string;
|
|
179
|
-
/** Optional Id that let us know users are coming from
|
|
177
|
+
/** Optional Id that let us know which integration system users are coming from (will be required in the future)*/
|
|
180
178
|
integrationSystemId?: string;
|
|
179
|
+
/** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
|
|
180
|
+
presentingIntegrationSystemId?: string;
|
|
181
181
|
}
|
|
182
182
|
```
|
|
183
183
|
|
package/dist/common/types.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface AdditionalInfoMessage {
|
|
|
7
7
|
additionalUserInfo?: AdditionalUserInfo;
|
|
8
8
|
featureAttributes?: FeatureAttributes;
|
|
9
9
|
themeInformation?: ThemeInformation;
|
|
10
|
+
integrationSystemId?: string;
|
|
11
|
+
presentingIntegrationSystemId?: string;
|
|
10
12
|
}
|
|
11
13
|
export interface ThemeInformation {
|
|
12
14
|
accent: string;
|
|
@@ -73,5 +75,6 @@ export interface InitOptions {
|
|
|
73
75
|
themeInformation?: ThemeInformation;
|
|
74
76
|
oneTimeToken?: string;
|
|
75
77
|
integrationSystemId?: string;
|
|
78
|
+
presentingIntegrationSystemId?: string;
|
|
76
79
|
}
|
|
77
80
|
export {};
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const constants_1 = require("../../common/constants");
|
|
7
7
|
const params_1 = require("../../common/params");
|
|
8
8
|
function useGo1ContentView(props) {
|
|
9
|
-
const { feature, featureAttributes, portalURL, oneTimeToken, onGo1MessageReceived, additionalUserInfo, themeInformation, integrationSystemId, env = 'production', } = props;
|
|
9
|
+
const { feature, featureAttributes, portalURL, oneTimeToken, onGo1MessageReceived, additionalUserInfo, themeInformation, integrationSystemId, presentingIntegrationSystemId, env = 'production', } = props;
|
|
10
10
|
const iframeRef = (0, react_1.useRef)(null);
|
|
11
11
|
let url = 'https://embedding.go1.com';
|
|
12
12
|
if (env === 'staging') {
|
|
@@ -26,12 +26,9 @@ function useGo1ContentView(props) {
|
|
|
26
26
|
if (oneTimeToken) {
|
|
27
27
|
(0, params_1.addOneTimeToken)(iframeURL, oneTimeToken);
|
|
28
28
|
}
|
|
29
|
-
if (integrationSystemId) {
|
|
30
|
-
iframeURL.searchParams.append('integration_system_id', integrationSystemId);
|
|
31
|
-
}
|
|
32
29
|
const iframeID = `go1-iframe-${feature}`;
|
|
33
30
|
return { iframeURL, iframeID };
|
|
34
|
-
}, [url, feature, portalURL, oneTimeToken,
|
|
31
|
+
}, [url, feature, portalURL, oneTimeToken, env]);
|
|
35
32
|
const eventListenerInstance = (0, react_1.useCallback)((event) => {
|
|
36
33
|
const { _type, ...rest } = event.data;
|
|
37
34
|
if (_type === constants_1.GO1_MESSAGE) {
|
|
@@ -40,6 +37,8 @@ function useGo1ContentView(props) {
|
|
|
40
37
|
additionalUserInfo,
|
|
41
38
|
themeInformation,
|
|
42
39
|
featureAttributes,
|
|
40
|
+
integrationSystemId,
|
|
41
|
+
presentingIntegrationSystemId,
|
|
43
42
|
};
|
|
44
43
|
sendMessageToGo1({
|
|
45
44
|
type: 'set_additional_embedding_data',
|
|
@@ -52,7 +51,15 @@ function useGo1ContentView(props) {
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
}, [
|
|
54
|
+
}, [
|
|
55
|
+
additionalUserInfo,
|
|
56
|
+
themeInformation,
|
|
57
|
+
featureAttributes,
|
|
58
|
+
integrationSystemId,
|
|
59
|
+
presentingIntegrationSystemId,
|
|
60
|
+
sendMessageToGo1,
|
|
61
|
+
onGo1MessageReceived,
|
|
62
|
+
]);
|
|
56
63
|
(0, react_1.useEffect)(() => {
|
|
57
64
|
window.addEventListener('message', eventListenerInstance);
|
|
58
65
|
return () => {
|