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/esm/svelte/index.js
CHANGED
|
@@ -12447,7 +12447,7 @@ class HumanBehaviorAPI {
|
|
|
12447
12447
|
entryURL = window.location.href;
|
|
12448
12448
|
referrer = document.referrer;
|
|
12449
12449
|
}
|
|
12450
|
-
|
|
12450
|
+
logInfo('API init called with:', { sessionId, userId, entryURL, referrer, baseUrl: this.baseUrl });
|
|
12451
12451
|
try {
|
|
12452
12452
|
const response = yield fetch(`${this.baseUrl}/api/ingestion/init`, {
|
|
12453
12453
|
method: 'POST',
|
|
@@ -12463,21 +12463,21 @@ class HumanBehaviorAPI {
|
|
|
12463
12463
|
referrer: referrer
|
|
12464
12464
|
})
|
|
12465
12465
|
});
|
|
12466
|
-
|
|
12466
|
+
logInfo('API init response status:', response.status);
|
|
12467
12467
|
if (!response.ok) {
|
|
12468
12468
|
const errorText = yield response.text();
|
|
12469
|
-
|
|
12469
|
+
logError('API init failed:', response.status, errorText);
|
|
12470
12470
|
throw new Error(`Failed to initialize ingestion: ${response.statusText} - ${errorText}`);
|
|
12471
12471
|
}
|
|
12472
12472
|
const responseJson = yield response.json();
|
|
12473
|
-
|
|
12473
|
+
logInfo('API init success:', responseJson);
|
|
12474
12474
|
return {
|
|
12475
12475
|
sessionId: responseJson.sessionId,
|
|
12476
12476
|
endUserId: responseJson.endUserId
|
|
12477
12477
|
};
|
|
12478
12478
|
}
|
|
12479
12479
|
catch (error) {
|
|
12480
|
-
|
|
12480
|
+
logError('API init error:', error);
|
|
12481
12481
|
throw error;
|
|
12482
12482
|
}
|
|
12483
12483
|
});
|
|
@@ -12580,7 +12580,7 @@ class HumanBehaviorAPI {
|
|
|
12580
12580
|
sessionId: sessionId,
|
|
12581
12581
|
posthogName: userData.email || userData.name || null // Update user name with email
|
|
12582
12582
|
};
|
|
12583
|
-
|
|
12583
|
+
logInfo('Sending user data to server:', payload);
|
|
12584
12584
|
const response = yield fetch(`${this.baseUrl}/api/ingestion/user`, {
|
|
12585
12585
|
method: 'POST',
|
|
12586
12586
|
headers: {
|
|
@@ -12593,7 +12593,7 @@ class HumanBehaviorAPI {
|
|
|
12593
12593
|
throw new Error(`Failed to send user data: ${response.statusText} with API key: ${this.apiKey}`);
|
|
12594
12594
|
}
|
|
12595
12595
|
const result = yield response.json();
|
|
12596
|
-
|
|
12596
|
+
logInfo('Server response:', result);
|
|
12597
12597
|
return result;
|
|
12598
12598
|
}
|
|
12599
12599
|
catch (error) {
|
|
@@ -13335,7 +13335,7 @@ class HumanBehaviorTracker {
|
|
|
13335
13335
|
this.originalPushState.apply(history, args);
|
|
13336
13336
|
// Track navigation event
|
|
13337
13337
|
this.trackNavigationEvent('pushState', this.previousUrl, this.currentUrl);
|
|
13338
|
-
// Take FullSnapshot on navigation
|
|
13338
|
+
// Take FullSnapshot on navigation
|
|
13339
13339
|
this.takeFullSnapshot();
|
|
13340
13340
|
};
|
|
13341
13341
|
// Override replaceState to capture programmatic navigation
|
|
@@ -13346,7 +13346,7 @@ class HumanBehaviorTracker {
|
|
|
13346
13346
|
this.originalReplaceState.apply(history, args);
|
|
13347
13347
|
// Track navigation event
|
|
13348
13348
|
this.trackNavigationEvent('replaceState', this.previousUrl, this.currentUrl);
|
|
13349
|
-
// Take FullSnapshot on navigation
|
|
13349
|
+
// Take FullSnapshot on navigation
|
|
13350
13350
|
this.takeFullSnapshot();
|
|
13351
13351
|
};
|
|
13352
13352
|
// Listen for popstate events (back/forward navigation)
|
|
@@ -13354,7 +13354,7 @@ class HumanBehaviorTracker {
|
|
|
13354
13354
|
this.previousUrl = this.currentUrl;
|
|
13355
13355
|
this.currentUrl = window.location.href;
|
|
13356
13356
|
this.trackNavigationEvent('popstate', this.previousUrl, this.currentUrl);
|
|
13357
|
-
// Take FullSnapshot on navigation
|
|
13357
|
+
// Take FullSnapshot on navigation
|
|
13358
13358
|
this.takeFullSnapshot();
|
|
13359
13359
|
};
|
|
13360
13360
|
window.addEventListener('popstate', popstateListener);
|
|
@@ -13744,7 +13744,7 @@ class HumanBehaviorTracker {
|
|
|
13744
13744
|
viewLogs() {
|
|
13745
13745
|
try {
|
|
13746
13746
|
const logs = logger.getLogs();
|
|
13747
|
-
|
|
13747
|
+
logInfo('HumanBehavior Logs:', logs);
|
|
13748
13748
|
logger.clearLogs(); // Clear logs after viewing
|
|
13749
13749
|
}
|
|
13750
13750
|
catch (e) {
|
|
@@ -13812,9 +13812,8 @@ class HumanBehaviorTracker {
|
|
|
13812
13812
|
recordCrossOriginIframes: false, // HumanBehavior default
|
|
13813
13813
|
// ✅ CANVAS RECORDING - Disabled to prevent large data URIs
|
|
13814
13814
|
recordCanvas: false, // Disabled to prevent large data URIs
|
|
13815
|
-
// ✅ FULLSNAPSHOT GENERATION -
|
|
13816
|
-
//
|
|
13817
|
-
// They rely on initial FullSnapshot + navigation-triggered ones only
|
|
13815
|
+
// ✅ FULLSNAPSHOT GENERATION - No periodic snapshots to avoid animation issues
|
|
13816
|
+
// Rely on initial FullSnapshot + navigation-triggered ones only
|
|
13818
13817
|
});
|
|
13819
13818
|
// Store the record instance for cleanup
|
|
13820
13819
|
this.recordInstance = recordInstance || null;
|