humanbehavior-js 0.4.7 → 0.4.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/cjs/angular/index.cjs +13 -14
- package/dist/cjs/angular/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +14 -15
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/install-wizard.cjs +4 -2
- package/dist/cjs/install-wizard.cjs.map +1 -1
- package/dist/cjs/react/index.cjs +13 -14
- package/dist/cjs/react/index.cjs.map +1 -1
- package/dist/cjs/remix/index.cjs +13 -14
- package/dist/cjs/remix/index.cjs.map +1 -1
- package/dist/cjs/svelte/index.cjs +13 -14
- package/dist/cjs/svelte/index.cjs.map +1 -1
- package/dist/cjs/vue/index.cjs +13 -14
- package/dist/cjs/vue/index.cjs.map +1 -1
- package/dist/cjs/wizard/index.cjs +3208 -0
- package/dist/cjs/wizard/index.cjs.map +1 -0
- package/dist/cli/ai-auto-install.js +2024 -0
- package/dist/cli/ai-auto-install.js.map +1 -0
- package/dist/cli/auto-install.js +4 -2
- package/dist/cli/auto-install.js.map +1 -1
- package/dist/esm/angular/index.js +13 -14
- package/dist/esm/angular/index.js.map +1 -1
- package/dist/esm/index.js +14 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/install-wizard.js +4 -2
- package/dist/esm/install-wizard.js.map +1 -1
- package/dist/esm/react/index.js +13 -14
- package/dist/esm/react/index.js.map +1 -1
- package/dist/esm/remix/index.js +13 -14
- package/dist/esm/remix/index.js.map +1 -1
- package/dist/esm/svelte/index.js +13 -14
- package/dist/esm/svelte/index.js.map +1 -1
- package/dist/esm/vue/index.js +13 -14
- package/dist/esm/vue/index.js.map +1 -1
- package/dist/esm/wizard/index.js +3178 -0
- package/dist/esm/wizard/index.js.map +1 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/types/install-wizard.d.ts +8 -8
- package/dist/types/wizard/index.d.ts +489 -0
- package/package.json +14 -8
- package/rollup.config.js +65 -3
- package/src/api.ts +9 -9
- package/src/react/AutoInstallWizard.tsx +1 -1
- package/src/tracker.ts +6 -7
- package/src/wizard/README.md +114 -0
- package/src/wizard/ai/ai-install-wizard.ts +894 -0
- package/src/wizard/ai/manual-framework-wizard.ts +236 -0
- package/src/wizard/cli/ai-auto-install.ts +369 -0
- package/src/{cli → wizard/cli}/auto-install.ts +1 -1
- package/src/{install-wizard.ts → wizard/core/install-wizard.ts} +12 -10
- package/src/wizard/index.ts +23 -0
- package/src/wizard/services/centralized-ai-service.ts +668 -0
- package/src/wizard/services/remote-ai-service.ts +224 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -12406,7 +12406,7 @@ function validateSingleEventSize(event, sessionId) {
|
|
|
12406
12406
|
})).length;
|
|
12407
12407
|
if (singleEventSize > MAX_CHUNK_SIZE_BYTES) {
|
|
12408
12408
|
// Instead of throwing, log a warning and suggest reducing event size
|
|
12409
|
-
|
|
12409
|
+
logWarn(`Single event size (${singleEventSize} bytes) exceeds maximum chunk size (${MAX_CHUNK_SIZE_BYTES} bytes). Consider reducing event data size.`);
|
|
12410
12410
|
}
|
|
12411
12411
|
}
|
|
12412
12412
|
function splitLargeEvent(event, sessionId) {
|
|
@@ -12459,7 +12459,7 @@ class HumanBehaviorAPI {
|
|
|
12459
12459
|
entryURL = window.location.href;
|
|
12460
12460
|
referrer = document.referrer;
|
|
12461
12461
|
}
|
|
12462
|
-
|
|
12462
|
+
logInfo('API init called with:', { sessionId, userId, entryURL, referrer, baseUrl: this.baseUrl });
|
|
12463
12463
|
try {
|
|
12464
12464
|
const response = yield fetch(`${this.baseUrl}/api/ingestion/init`, {
|
|
12465
12465
|
method: 'POST',
|
|
@@ -12475,21 +12475,21 @@ class HumanBehaviorAPI {
|
|
|
12475
12475
|
referrer: referrer
|
|
12476
12476
|
})
|
|
12477
12477
|
});
|
|
12478
|
-
|
|
12478
|
+
logInfo('API init response status:', response.status);
|
|
12479
12479
|
if (!response.ok) {
|
|
12480
12480
|
const errorText = yield response.text();
|
|
12481
|
-
|
|
12481
|
+
logError('API init failed:', response.status, errorText);
|
|
12482
12482
|
throw new Error(`Failed to initialize ingestion: ${response.statusText} - ${errorText}`);
|
|
12483
12483
|
}
|
|
12484
12484
|
const responseJson = yield response.json();
|
|
12485
|
-
|
|
12485
|
+
logInfo('API init success:', responseJson);
|
|
12486
12486
|
return {
|
|
12487
12487
|
sessionId: responseJson.sessionId,
|
|
12488
12488
|
endUserId: responseJson.endUserId
|
|
12489
12489
|
};
|
|
12490
12490
|
}
|
|
12491
12491
|
catch (error) {
|
|
12492
|
-
|
|
12492
|
+
logError('API init error:', error);
|
|
12493
12493
|
throw error;
|
|
12494
12494
|
}
|
|
12495
12495
|
});
|
|
@@ -12592,7 +12592,7 @@ class HumanBehaviorAPI {
|
|
|
12592
12592
|
sessionId: sessionId,
|
|
12593
12593
|
posthogName: userData.email || userData.name || null // Update user name with email
|
|
12594
12594
|
};
|
|
12595
|
-
|
|
12595
|
+
logInfo('Sending user data to server:', payload);
|
|
12596
12596
|
const response = yield fetch(`${this.baseUrl}/api/ingestion/user`, {
|
|
12597
12597
|
method: 'POST',
|
|
12598
12598
|
headers: {
|
|
@@ -12605,7 +12605,7 @@ class HumanBehaviorAPI {
|
|
|
12605
12605
|
throw new Error(`Failed to send user data: ${response.statusText} with API key: ${this.apiKey}`);
|
|
12606
12606
|
}
|
|
12607
12607
|
const result = yield response.json();
|
|
12608
|
-
|
|
12608
|
+
logInfo('Server response:', result);
|
|
12609
12609
|
return result;
|
|
12610
12610
|
}
|
|
12611
12611
|
catch (error) {
|
|
@@ -13347,7 +13347,7 @@ class HumanBehaviorTracker {
|
|
|
13347
13347
|
this.originalPushState.apply(history, args);
|
|
13348
13348
|
// Track navigation event
|
|
13349
13349
|
this.trackNavigationEvent('pushState', this.previousUrl, this.currentUrl);
|
|
13350
|
-
// Take FullSnapshot on navigation
|
|
13350
|
+
// Take FullSnapshot on navigation
|
|
13351
13351
|
this.takeFullSnapshot();
|
|
13352
13352
|
};
|
|
13353
13353
|
// Override replaceState to capture programmatic navigation
|
|
@@ -13358,7 +13358,7 @@ class HumanBehaviorTracker {
|
|
|
13358
13358
|
this.originalReplaceState.apply(history, args);
|
|
13359
13359
|
// Track navigation event
|
|
13360
13360
|
this.trackNavigationEvent('replaceState', this.previousUrl, this.currentUrl);
|
|
13361
|
-
// Take FullSnapshot on navigation
|
|
13361
|
+
// Take FullSnapshot on navigation
|
|
13362
13362
|
this.takeFullSnapshot();
|
|
13363
13363
|
};
|
|
13364
13364
|
// Listen for popstate events (back/forward navigation)
|
|
@@ -13366,7 +13366,7 @@ class HumanBehaviorTracker {
|
|
|
13366
13366
|
this.previousUrl = this.currentUrl;
|
|
13367
13367
|
this.currentUrl = window.location.href;
|
|
13368
13368
|
this.trackNavigationEvent('popstate', this.previousUrl, this.currentUrl);
|
|
13369
|
-
// Take FullSnapshot on navigation
|
|
13369
|
+
// Take FullSnapshot on navigation
|
|
13370
13370
|
this.takeFullSnapshot();
|
|
13371
13371
|
};
|
|
13372
13372
|
window.addEventListener('popstate', popstateListener);
|
|
@@ -13756,7 +13756,7 @@ class HumanBehaviorTracker {
|
|
|
13756
13756
|
viewLogs() {
|
|
13757
13757
|
try {
|
|
13758
13758
|
const logs = logger.getLogs();
|
|
13759
|
-
|
|
13759
|
+
logInfo('HumanBehavior Logs:', logs);
|
|
13760
13760
|
logger.clearLogs(); // Clear logs after viewing
|
|
13761
13761
|
}
|
|
13762
13762
|
catch (e) {
|
|
@@ -13824,9 +13824,8 @@ class HumanBehaviorTracker {
|
|
|
13824
13824
|
recordCrossOriginIframes: false, // HumanBehavior default
|
|
13825
13825
|
// ✅ CANVAS RECORDING - Disabled to prevent large data URIs
|
|
13826
13826
|
recordCanvas: false, // Disabled to prevent large data URIs
|
|
13827
|
-
// ✅ FULLSNAPSHOT GENERATION -
|
|
13828
|
-
//
|
|
13829
|
-
// They rely on initial FullSnapshot + navigation-triggered ones only
|
|
13827
|
+
// ✅ FULLSNAPSHOT GENERATION - No periodic snapshots to avoid animation issues
|
|
13828
|
+
// Rely on initial FullSnapshot + navigation-triggered ones only
|
|
13830
13829
|
});
|
|
13831
13830
|
// Store the record instance for cleanup
|
|
13832
13831
|
this.recordInstance = recordInstance || null;
|