@elliemae/pui-logrocket 1.0.1 → 1.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.
@@ -70,15 +70,26 @@ const defaultOptions = {
70
70
  },
71
71
  release: process?.env?.APP_VERSION,
72
72
  // app sdk based applications use this env variable to specify the app code version
73
- rootHostname: ".ice.com"
73
+ rootHostname: window.emui?.logRocketConfig?.rootHostname ?? ".ice.com",
74
+ childDomains: window.emui?.logRocketConfig?.childDomains ?? null,
75
+ parentDomain: window.emui?.logRocketConfig?.parentDomain ?? null
74
76
  };
75
- const initLogRocket = (id, options) => {
76
- const { isReact = true, ...rest } = options ?? {};
77
+ const initLogRocket = (options) => {
78
+ const {
79
+ appId = window.emui?.logRocketConfig?.appId,
80
+ isReact = true,
81
+ ...rest
82
+ } = options ?? {};
83
+ if (!appId) {
84
+ throw new Error(
85
+ "LogRocket appId is required to initialize LogRocket. Either pass it as parameter or set window.emui.logRocketConfig.appId"
86
+ );
87
+ }
77
88
  if (window.location.hostname === "localhost" && process.env.LOGROCKET_ENABLE_ON_LOCALHOST !== "true") {
78
89
  console.info("LogRocket is not initialized in localhost");
79
90
  return;
80
91
  }
81
- import_logrocket.default.init(id, { ...defaultOptions, ...rest });
92
+ import_logrocket.default.init(appId, { ...defaultOptions, ...rest });
82
93
  if (isReact) {
83
94
  setupLogRocketReact(import_logrocket.default);
84
95
  }
@@ -36,15 +36,26 @@ const defaultOptions = {
36
36
  },
37
37
  release: process?.env?.APP_VERSION,
38
38
  // app sdk based applications use this env variable to specify the app code version
39
- rootHostname: ".ice.com"
39
+ rootHostname: window.emui?.logRocketConfig?.rootHostname ?? ".ice.com",
40
+ childDomains: window.emui?.logRocketConfig?.childDomains ?? null,
41
+ parentDomain: window.emui?.logRocketConfig?.parentDomain ?? null
40
42
  };
41
- const initLogRocket = (id, options) => {
42
- const { isReact = true, ...rest } = options ?? {};
43
+ const initLogRocket = (options) => {
44
+ const {
45
+ appId = window.emui?.logRocketConfig?.appId,
46
+ isReact = true,
47
+ ...rest
48
+ } = options ?? {};
49
+ if (!appId) {
50
+ throw new Error(
51
+ "LogRocket appId is required to initialize LogRocket. Either pass it as parameter or set window.emui.logRocketConfig.appId"
52
+ );
53
+ }
43
54
  if (window.location.hostname === "localhost" && process.env.LOGROCKET_ENABLE_ON_LOCALHOST !== "true") {
44
55
  console.info("LogRocket is not initialized in localhost");
45
56
  return;
46
57
  }
47
- LogRocket.init(id, { ...defaultOptions, ...rest });
58
+ LogRocket.init(appId, { ...defaultOptions, ...rest });
48
59
  if (isReact) {
49
60
  setupLogRocketReact(LogRocket);
50
61
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Library Boilerplate</title><script defer="defer" src="js/emuiLogrocket.39770f624a74bf9d8e47.js"></script></head><body></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Library Boilerplate</title><script defer="defer" src="js/emuiLogrocket.6856581ccca61dc0bae2.js"></script></head><body></body></html>