@prodact.ai/sdk 0.0.8 → 0.0.10

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
@@ -1277,7 +1277,15 @@ var UserFlowTracker = class {
1277
1277
  console.warn("[UserFlow] Cannot track outside browser environment");
1278
1278
  return null;
1279
1279
  }
1280
+ console.log("[UserFlow] start() called", {
1281
+ enabled: this.config.enabled,
1282
+ samplingRate: this.config.samplingRate,
1283
+ currentState: this.state,
1284
+ apiUrl: this.apiUrl,
1285
+ hasSessionToken: !!this.sessionToken
1286
+ });
1280
1287
  if (!this.config.enabled) {
1288
+ console.warn("[UserFlow] Tracking disabled by config");
1281
1289
  return null;
1282
1290
  }
1283
1291
  if (this.state === "tracking") {
@@ -2061,11 +2069,13 @@ Check the Network tab in DevTools for more details.`
2061
2069
  role: "assistant",
2062
2070
  content: result.message?.content || result.response || "",
2063
2071
  visualFlows: result.flows || [],
2064
- images: result.images || []
2072
+ images: result.images || [],
2073
+ userFlows: result.userFlows || []
2065
2074
  };
2066
2075
  await this.log("info", "Chat response received", {
2067
2076
  hasFlows: (result.flows || []).length > 0,
2068
- hasImages: (result.images || []).length > 0
2077
+ hasImages: (result.images || []).length > 0,
2078
+ hasUserFlows: (result.userFlows || []).length > 0
2069
2079
  });
2070
2080
  this.emit("message", chatMessage);
2071
2081
  return chatMessage;
@@ -2631,6 +2641,15 @@ Check the Network tab in DevTools for more details.`
2631
2641
  */
2632
2642
  async initUserFlowTracking() {
2633
2643
  try {
2644
+ console.log(
2645
+ "%c\u{1F4CA} Initializing User Flow Tracking",
2646
+ "background: #8b5cf6; color: #fff; padding: 2px 6px; border-radius: 3px;",
2647
+ {
2648
+ config: this.config.userFlows,
2649
+ apiUrl: this.config.apiUrl,
2650
+ sdkKey: this.config.sdkKey ? "present" : "missing"
2651
+ }
2652
+ );
2634
2653
  this.userFlowTracker = new UserFlowTracker(this.config.userFlows);
2635
2654
  this.userFlowTracker.initialize(
2636
2655
  this.sessionToken,
@@ -2640,12 +2659,27 @@ Check the Network tab in DevTools for more details.`
2640
2659
  const recordingSessionId = this.recorder?.getSessionId?.() || null;
2641
2660
  const sessionId = await this.userFlowTracker.start(recordingSessionId);
2642
2661
  if (sessionId) {
2662
+ console.log(
2663
+ "%c\u2705 User Flow Tracking Started",
2664
+ "background: #10b981; color: #fff; padding: 2px 6px; border-radius: 3px;",
2665
+ { flowSessionId: sessionId, linkedRecordingSession: recordingSessionId }
2666
+ );
2643
2667
  await this.log("info", "User flow tracking started", {
2644
2668
  flowSessionId: sessionId,
2645
2669
  linkedRecordingSession: recordingSessionId
2646
2670
  });
2671
+ } else {
2672
+ console.warn(
2673
+ "%c\u26A0\uFE0F User Flow Tracking: No session ID returned",
2674
+ "background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px;"
2675
+ );
2647
2676
  }
2648
2677
  } catch (error) {
2678
+ console.error(
2679
+ "%c\u274C User Flow Tracking Failed",
2680
+ "background: #ef4444; color: #fff; padding: 2px 6px; border-radius: 3px;",
2681
+ error
2682
+ );
2649
2683
  await this.log("warn", "Failed to initialize user flow tracking", {
2650
2684
  error: error instanceof Error ? error.message : String(error)
2651
2685
  });