@web3auth/no-modal 10.15.0 → 10.16.0

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.
@@ -13,6 +13,9 @@ class Analytics {
13
13
  _defineProperty(this, "enabled", true);
14
14
  }
15
15
  init() {
16
+ if (!this.enabled) {
17
+ return;
18
+ }
16
19
  if (this.isSkipped()) {
17
20
  return;
18
21
  }
@@ -75,7 +78,7 @@ class Analytics {
75
78
  }
76
79
  isSkipped() {
77
80
  const dappOrigin = window.location.origin;
78
- // skip if the protocol is not http or https
81
+ // skip if the protocol is http
79
82
  if (dappOrigin.startsWith("http://")) {
80
83
  return true;
81
84
  }
@@ -147,7 +147,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
147
147
  ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig10 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig10 === void 0 ? void 0 : _walletServicesConfig10.defaultPortfolio
148
148
  };
149
149
  };
150
- const sdkVersion = "10.15.0";
150
+ const sdkVersion = "10.16.0";
151
151
  const getErrorAnalyticsProperties = error => {
152
152
  try {
153
153
  const code = error instanceof index.Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
@@ -52,6 +52,9 @@ class Web3AuthNoModal extends auth.SafeEventEmitter {
52
52
  this.coreOptions = options;
53
53
  this.storage = this.getStorageMethod();
54
54
  this.analytics = new analytics.Analytics();
55
+ if (options.disableAnalytics) {
56
+ this.analytics.disable();
57
+ }
55
58
  this.analytics.setGlobalProperties({
56
59
  integration_type: analytics.ANALYTICS_INTEGRATION_TYPE.NATIVE_SDK
57
60
  });
@@ -135,6 +135,11 @@ export interface IWeb3AuthCoreOptions {
135
135
  * @defaultValue "connect-only"
136
136
  */
137
137
  initialAuthenticationMode?: ConnectorInitialAuthenticationModeType;
138
+ /**
139
+ * Whether to disable analytics
140
+ * @defaultValue false
141
+ */
142
+ disableAnalytics?: boolean;
138
143
  }
139
144
  export type LoginParamMap = {
140
145
  [WALLET_CONNECTORS.AUTH]: Partial<AuthLoginParams>;
@@ -11,6 +11,9 @@ class Analytics {
11
11
  _defineProperty(this, "enabled", true);
12
12
  }
13
13
  init() {
14
+ if (!this.enabled) {
15
+ return;
16
+ }
14
17
  if (this.isSkipped()) {
15
18
  return;
16
19
  }
@@ -74,7 +77,7 @@ class Analytics {
74
77
  isSkipped() {
75
78
  const dappOrigin = window.location.origin;
76
79
 
77
- // skip if the protocol is not http or https
80
+ // skip if the protocol is http
78
81
  if (dappOrigin.startsWith("http://")) {
79
82
  return true;
80
83
  }
@@ -146,7 +146,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
146
146
  ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig10 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig10 === void 0 ? void 0 : _walletServicesConfig10.defaultPortfolio
147
147
  };
148
148
  };
149
- const sdkVersion = "10.15.0";
149
+ const sdkVersion = "10.16.0";
150
150
  const getErrorAnalyticsProperties = error => {
151
151
  try {
152
152
  const code = error instanceof Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
@@ -47,6 +47,9 @@ class Web3AuthNoModal extends SafeEventEmitter {
47
47
  this.coreOptions = options;
48
48
  this.storage = this.getStorageMethod();
49
49
  this.analytics = new Analytics();
50
+ if (options.disableAnalytics) {
51
+ this.analytics.disable();
52
+ }
50
53
  this.analytics.setGlobalProperties({
51
54
  integration_type: ANALYTICS_INTEGRATION_TYPE.NATIVE_SDK
52
55
  });