@amplifyup/sdk 0.1.76 → 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.mjs CHANGED
@@ -155,6 +155,7 @@ var AWSAdapter = class {
155
155
  return;
156
156
  }
157
157
  const trackingId = eventData?.trackingId || this.config?.trackingId;
158
+ const debug = this.config?.debug;
158
159
  const query = trackingId ? `?tid=${encodeURIComponent(trackingId)}` : "";
159
160
  const url = `${this.apiGatewayUrl}${endpoint}${query}`;
160
161
  try {
@@ -169,15 +170,15 @@ var AWSAdapter = class {
169
170
  keepalive: true
170
171
  });
171
172
  if (!response.ok) {
172
- if (this.config.debug) {
173
+ if (debug) {
173
174
  console.warn(`AmplifyUp SDK: Event tracking failed: ${response.status} ${response.statusText}`);
174
175
  }
175
- } else if (this.config.debug) {
176
+ } else if (debug) {
176
177
  const result = await response.json().catch(() => ({}));
177
178
  console.log("AmplifyUp SDK: Event tracked", result);
178
179
  }
179
180
  } catch (error) {
180
- if (this.config.debug) {
181
+ if (debug) {
181
182
  console.error("AmplifyUp SDK: Event tracking error:", error);
182
183
  }
183
184
  }