@commercetools-frontend/fullstory 2.0.1 → 2.0.3

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.
@@ -112,6 +112,10 @@ function useTrackingEffect() {
112
112
  // NOTE: This type is not exported from the @fullstory/browser package.
113
113
 
114
114
  function sendEvent(eventName, eventProperties) {
115
+ // Don't send events if FullStory is not initialized.
116
+ if (!FullStory__namespace.isInitialized()) {
117
+ return;
118
+ }
115
119
  FullStory__namespace.event(eventName, eventProperties);
116
120
  }
117
121
 
@@ -112,6 +112,10 @@ function useTrackingEffect() {
112
112
  // NOTE: This type is not exported from the @fullstory/browser package.
113
113
 
114
114
  function sendEvent(eventName, eventProperties) {
115
+ // Don't send events if FullStory is not initialized.
116
+ if (!FullStory__namespace.isInitialized()) {
117
+ return;
118
+ }
115
119
  FullStory__namespace.event(eventName, eventProperties);
116
120
  }
117
121
 
@@ -78,6 +78,10 @@ function useTrackingEffect() {
78
78
  // NOTE: This type is not exported from the @fullstory/browser package.
79
79
 
80
80
  function sendEvent(eventName, eventProperties) {
81
+ // Don't send events if FullStory is not initialized.
82
+ if (!FullStory.isInitialized()) {
83
+ return;
84
+ }
81
85
  FullStory.event(eventName, eventProperties);
82
86
  }
83
87
 
@@ -1,5 +1,5 @@
1
- export { initialize } from './initialize';
2
- export { useTrackingEffect } from './tracking-effect';
3
- export { sendEvent } from './send-event';
4
- export { setUserVars } from './set-user-vars';
5
- export { Masking } from './masking';
1
+ export { initialize } from "./initialize.js";
2
+ export { useTrackingEffect } from "./tracking-effect.js";
3
+ export { sendEvent } from "./send-event.js";
4
+ export { setUserVars } from "./set-user-vars.js";
5
+ export { Masking } from "./masking.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/fullstory",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "A package integrating with the FullStory SDK",
5
5
  "license": "MIT",
6
6
  "main": "dist/commercetools-frontend-fullstory.cjs.js",
@@ -20,17 +20,17 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@apollo/client": "3.7.10",
23
- "@commercetools-frontend/application-shell": "22.2.1",
24
- "@commercetools-frontend/application-shell-connectors": "22.2.1",
25
- "@commercetools-frontend/constants": "22.2.1",
23
+ "@commercetools-frontend/application-shell": "22.4.0",
24
+ "@commercetools-frontend/application-shell-connectors": "22.4.0",
25
+ "@commercetools-frontend/constants": "22.4.0",
26
26
  "@testing-library/react": "12.1.5",
27
27
  "@testing-library/react-hooks": "8.0.1",
28
- "@types/node": "18.16.5",
29
- "@types/react": "17.0.59",
30
- "graphql": "16.6.0",
28
+ "@types/node": "20.4.4",
29
+ "@types/react": "17.0.62",
30
+ "graphql": "16.7.1",
31
31
  "react": "17.0.2",
32
32
  "react-dom": "17.0.2",
33
- "react-intl": "6.4.2",
33
+ "react-intl": "6.4.4",
34
34
  "react-redux": "7.2.9",
35
35
  "react-router-dom": "5.3.4",
36
36
  "redux": "4.2.1",