@syntrologie/runtime-sdk 2.9.0 → 2.11.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.
@@ -71,6 +71,24 @@ export interface PostHogAdapterOptions {
71
71
  * @default false
72
72
  */
73
73
  requireExplicitConsent?: boolean;
74
+ /**
75
+ * Enable behavioral signal detection (hesitation, rage click, etc.)
76
+ * Pass `true` for defaults, or a partial DetectorConfig to customize thresholds.
77
+ * @default false
78
+ */
79
+ behavioralSignals?: boolean | Record<string, number>;
80
+ /**
81
+ * Endpoint URL to mirror session recording payloads.
82
+ * When set, recording requests to PostHog's /s/ endpoint are also
83
+ * sent (fire-and-forget) to this URL.
84
+ */
85
+ replayMirrorEndpoint?: string;
86
+ /**
87
+ * Callback for raw rrweb events from session recording.
88
+ * Called with each rrweb eventWithTime before PostHog processes it.
89
+ * Used by the event processor for behavioral signal detection.
90
+ */
91
+ onRRWebEvent?: (event: Record<string, unknown>) => void;
74
92
  }
75
93
  interface CanvasAnalyticsPayload extends Properties {
76
94
  rectangleId?: string;
@@ -84,6 +102,7 @@ export declare class PostHogAdapter implements TelemetryClient {
84
102
  private client?;
85
103
  private featureFlagsCallback?;
86
104
  private captureCallback?;
105
+ private rrwebCallback?;
87
106
  private consentUnsub?;
88
107
  constructor(options?: PostHogAdapterOptions);
89
108
  /**
@@ -91,6 +110,18 @@ export declare class PostHogAdapter implements TelemetryClient {
91
110
  * or deferred (when consent gate grants).
92
111
  */
93
112
  private initPostHog;
113
+ /**
114
+ * Set up rrweb event interception on PostHog's session recording.
115
+ *
116
+ * PostHog lazy-loads the rrweb recorder. The SessionRecording wrapper has
117
+ * an `onRRwebEmit` method, but rrweb delivers events directly to the
118
+ * lazy-loaded recorder instance's `onRRwebEmit`, bypassing the wrapper.
119
+ * We must find and patch the recorder instance, not the wrapper.
120
+ *
121
+ * The recorder instance is stored on a minified property of SessionRecording.
122
+ * We detect it by looking for an object with both `onRRwebEmit` and `start` methods.
123
+ */
124
+ private setupRRWebIntercept;
94
125
  /**
95
126
  * Get all feature flags from PostHog.
96
127
  * Used to extract segment membership flags (in_segment_*).
@@ -0,0 +1,7 @@
1
+ interface ReplayMirrorOptions {
2
+ posthogHost: string;
3
+ mirrorEndpoint: string;
4
+ sessionIdHeader?: string;
5
+ }
6
+ export declare function setupReplayMirror(options: ReplayMirrorOptions): () => void;
7
+ export {};
package/dist/version.d.ts CHANGED
@@ -10,4 +10,4 @@
10
10
  *
11
11
  * @since 2.0.0
12
12
  */
13
- export declare const SDK_VERSION = "2.9.0";
13
+ export declare const SDK_VERSION = "2.11.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/runtime-sdk",
3
- "version": "2.9.0",
3
+ "version": "2.11.0",
4
4
  "description": "Syntrologie Runtime SDK for web experimentation and analytics",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -67,12 +67,13 @@
67
67
  "@floating-ui/dom": "^1.7.5",
68
68
  "@growthbook/growthbook": "~1.6.2",
69
69
  "@growthbook/growthbook-react": "^1.6.4",
70
- "@syntrologie/adapt-chatbot": "2.9.0",
71
- "@syntrologie/adapt-content": "2.9.0",
72
- "@syntrologie/adapt-faq": "2.9.0",
73
- "@syntrologie/adapt-gamification": "2.9.0",
74
- "@syntrologie/adapt-nav": "2.9.0",
75
- "@syntrologie/adapt-overlays": "2.9.0",
70
+ "@syntrologie/adapt-chatbot": "2.11.0",
71
+ "@syntrologie/adapt-content": "2.11.0",
72
+ "@syntrologie/adapt-faq": "2.11.0",
73
+ "@syntrologie/adapt-gamification": "2.11.0",
74
+ "@syntrologie/adapt-nav": "2.11.0",
75
+ "@syntrologie/adapt-overlays": "2.11.0",
76
+ "@syntrologie/event-processor": "*",
76
77
  "lucide-react": "^0.576.0",
77
78
  "posthog-js": "~1.302.2",
78
79
  "zod": "^3.25.76"