@amplifyup/sdk 0.1.77 → 0.1.78

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/dist/index.js CHANGED
@@ -159,6 +159,7 @@ var AWSAdapter = class {
159
159
  return;
160
160
  }
161
161
  const trackingId = eventData?.trackingId || this.config?.trackingId;
162
+ const debug = this.config?.debug;
162
163
  const query = trackingId ? `?tid=${encodeURIComponent(trackingId)}` : "";
163
164
  const url = `${this.apiGatewayUrl}${endpoint}${query}`;
164
165
  try {
@@ -173,15 +174,15 @@ var AWSAdapter = class {
173
174
  keepalive: true
174
175
  });
175
176
  if (!response.ok) {
176
- if (this.config.debug) {
177
+ if (debug) {
177
178
  console.warn(`AmplifyUp SDK: Event tracking failed: ${response.status} ${response.statusText}`);
178
179
  }
179
- } else if (this.config.debug) {
180
+ } else if (debug) {
180
181
  const result = await response.json().catch(() => ({}));
181
182
  console.log("AmplifyUp SDK: Event tracked", result);
182
183
  }
183
184
  } catch (error) {
184
- if (this.config.debug) {
185
+ if (debug) {
185
186
  console.error("AmplifyUp SDK: Event tracking error:", error);
186
187
  }
187
188
  }