@prodact.ai/sdk 0.0.8 → 0.0.9

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
@@ -1234,7 +1234,15 @@ var UserFlowTracker = class {
1234
1234
  console.warn("[UserFlow] Cannot track outside browser environment");
1235
1235
  return null;
1236
1236
  }
1237
+ console.log("[UserFlow] start() called", {
1238
+ enabled: this.config.enabled,
1239
+ samplingRate: this.config.samplingRate,
1240
+ currentState: this.state,
1241
+ apiUrl: this.apiUrl,
1242
+ hasSessionToken: !!this.sessionToken
1243
+ });
1237
1244
  if (!this.config.enabled) {
1245
+ console.warn("[UserFlow] Tracking disabled by config");
1238
1246
  return null;
1239
1247
  }
1240
1248
  if (this.state === "tracking") {
@@ -2588,6 +2596,15 @@ Check the Network tab in DevTools for more details.`
2588
2596
  */
2589
2597
  async initUserFlowTracking() {
2590
2598
  try {
2599
+ console.log(
2600
+ "%c\u{1F4CA} Initializing User Flow Tracking",
2601
+ "background: #8b5cf6; color: #fff; padding: 2px 6px; border-radius: 3px;",
2602
+ {
2603
+ config: this.config.userFlows,
2604
+ apiUrl: this.config.apiUrl,
2605
+ sdkKey: this.config.sdkKey ? "present" : "missing"
2606
+ }
2607
+ );
2591
2608
  this.userFlowTracker = new UserFlowTracker(this.config.userFlows);
2592
2609
  this.userFlowTracker.initialize(
2593
2610
  this.sessionToken,
@@ -2597,12 +2614,27 @@ Check the Network tab in DevTools for more details.`
2597
2614
  const recordingSessionId = this.recorder?.getSessionId?.() || null;
2598
2615
  const sessionId = await this.userFlowTracker.start(recordingSessionId);
2599
2616
  if (sessionId) {
2617
+ console.log(
2618
+ "%c\u2705 User Flow Tracking Started",
2619
+ "background: #10b981; color: #fff; padding: 2px 6px; border-radius: 3px;",
2620
+ { flowSessionId: sessionId, linkedRecordingSession: recordingSessionId }
2621
+ );
2600
2622
  await this.log("info", "User flow tracking started", {
2601
2623
  flowSessionId: sessionId,
2602
2624
  linkedRecordingSession: recordingSessionId
2603
2625
  });
2626
+ } else {
2627
+ console.warn(
2628
+ "%c\u26A0\uFE0F User Flow Tracking: No session ID returned",
2629
+ "background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px;"
2630
+ );
2604
2631
  }
2605
2632
  } catch (error) {
2633
+ console.error(
2634
+ "%c\u274C User Flow Tracking Failed",
2635
+ "background: #ef4444; color: #fff; padding: 2px 6px; border-radius: 3px;",
2636
+ error
2637
+ );
2606
2638
  await this.log("warn", "Failed to initialize user flow tracking", {
2607
2639
  error: error instanceof Error ? error.message : String(error)
2608
2640
  });