humanbehavior-js 0.4.27 → 0.5.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.
- package/README.md +151 -0
- package/package.json +114 -71
- package/packages/angular/dist/index.d.ts +46 -0
- package/packages/angular/dist/index.d.ts.map +1 -0
- package/packages/angular/dist/index.js +2 -0
- package/packages/angular/dist/index.js.map +1 -0
- package/packages/angular/dist/index.mjs +2 -0
- package/packages/angular/dist/index.mjs.map +1 -0
- package/packages/browser/dist/index.d.ts +5 -0
- package/packages/browser/dist/index.d.ts.map +1 -0
- package/packages/browser/dist/index.iife.js +12095 -0
- package/packages/browser/dist/index.iife.js.map +1 -0
- package/packages/browser/dist/index.js +2 -0
- package/packages/browser/dist/index.js.map +1 -0
- package/packages/browser/dist/index.min.js +2 -0
- package/packages/browser/dist/index.min.js.map +1 -0
- package/packages/browser/dist/index.mjs +2 -0
- package/packages/browser/dist/index.mjs.map +1 -0
- package/packages/react/dist/browser.d.ts +2 -0
- package/packages/react/dist/browser.d.ts.map +1 -0
- package/packages/react/dist/index.d.ts +48 -0
- package/packages/react/dist/index.d.ts.map +1 -0
- package/packages/react/dist/index.js +2 -0
- package/packages/react/dist/index.js.map +1 -0
- package/packages/react/dist/index.mjs +2 -0
- package/packages/react/dist/index.mjs.map +1 -0
- package/packages/remix/dist/index.d.ts +8 -0
- package/packages/remix/dist/index.d.ts.map +1 -0
- package/packages/remix/dist/index.js +2 -0
- package/packages/remix/dist/index.js.map +1 -0
- package/packages/remix/dist/index.mjs +2 -0
- package/packages/remix/dist/index.mjs.map +1 -0
- package/packages/svelte/dist/index.d.ts +11 -0
- package/packages/svelte/dist/index.d.ts.map +1 -0
- package/packages/svelte/dist/index.js +2 -0
- package/packages/svelte/dist/index.js.map +1 -0
- package/packages/svelte/dist/index.mjs +2 -0
- package/packages/svelte/dist/index.mjs.map +1 -0
- package/{dist/types/vue → packages/vue/dist}/index.d.ts +4 -5
- package/packages/vue/dist/index.d.ts.map +1 -0
- package/packages/vue/dist/index.js +2 -0
- package/packages/vue/dist/index.js.map +1 -0
- package/packages/vue/dist/index.mjs +2 -0
- package/packages/vue/dist/index.mjs.map +1 -0
- package/packages/wizard/dist/ai/ai-install-wizard.d.ts +145 -0
- package/packages/wizard/dist/ai/ai-install-wizard.d.ts.map +1 -0
- package/packages/wizard/dist/ai/manual-framework-wizard.d.ts +52 -0
- package/packages/wizard/dist/ai/manual-framework-wizard.d.ts.map +1 -0
- package/packages/wizard/dist/cli/ai-auto-install.d.ts +27 -0
- package/packages/wizard/dist/cli/ai-auto-install.d.ts.map +1 -0
- package/{dist → packages/wizard/dist}/cli/ai-auto-install.js +821 -905
- package/packages/wizard/dist/cli/ai-auto-install.js.map +1 -0
- package/packages/wizard/dist/cli/auto-install.d.ts +26 -0
- package/packages/wizard/dist/cli/auto-install.d.ts.map +1 -0
- package/{dist → packages/wizard/dist}/cli/auto-install.js +821 -905
- package/packages/wizard/dist/cli/auto-install.js.map +1 -0
- package/{dist/types → packages/wizard/dist/core}/install-wizard.d.ts +6 -8
- package/packages/wizard/dist/core/install-wizard.d.ts.map +1 -0
- package/packages/wizard/dist/index.d.ts +18 -0
- package/packages/wizard/dist/index.d.ts.map +1 -0
- package/packages/wizard/dist/index.js +2 -0
- package/packages/wizard/dist/index.js.map +1 -0
- package/packages/wizard/dist/index.mjs +2 -0
- package/packages/wizard/dist/index.mjs.map +1 -0
- package/packages/wizard/dist/services/centralized-ai-service.d.ts +159 -0
- package/packages/wizard/dist/services/centralized-ai-service.d.ts.map +1 -0
- package/packages/wizard/dist/services/remote-ai-service.d.ts +58 -0
- package/packages/wizard/dist/services/remote-ai-service.d.ts.map +1 -0
- package/WIZARD_USAGE_GUIDE.md +0 -381
- package/dist/cjs/angular/index.cjs +0 -14979
- package/dist/cjs/angular/index.cjs.map +0 -1
- package/dist/cjs/index.cjs +0 -14964
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/install-wizard.cjs +0 -1576
- package/dist/cjs/install-wizard.cjs.map +0 -1
- package/dist/cjs/react/index.cjs +0 -15103
- package/dist/cjs/react/index.cjs.map +0 -1
- package/dist/cjs/remix/index.cjs +0 -15077
- package/dist/cjs/remix/index.cjs.map +0 -1
- package/dist/cjs/svelte/index.cjs +0 -14933
- package/dist/cjs/svelte/index.cjs.map +0 -1
- package/dist/cjs/vue/index.cjs +0 -14942
- package/dist/cjs/vue/index.cjs.map +0 -1
- package/dist/cjs/wizard/index.cjs +0 -3490
- package/dist/cjs/wizard/index.cjs.map +0 -1
- package/dist/cli/ai-auto-install.js.map +0 -1
- package/dist/cli/auto-install.js.map +0 -1
- package/dist/esm/angular/index.js +0 -14975
- package/dist/esm/angular/index.js.map +0 -1
- package/dist/esm/index.js +0 -14941
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/install-wizard.js +0 -1553
- package/dist/esm/install-wizard.js.map +0 -1
- package/dist/esm/react/index.js +0 -15097
- package/dist/esm/react/index.js.map +0 -1
- package/dist/esm/remix/index.js +0 -15073
- package/dist/esm/remix/index.js.map +0 -1
- package/dist/esm/svelte/index.js +0 -14931
- package/dist/esm/svelte/index.js.map +0 -1
- package/dist/esm/vue/index.js +0 -14940
- package/dist/esm/vue/index.js.map +0 -1
- package/dist/esm/wizard/index.js +0 -3459
- package/dist/esm/wizard/index.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/dist/types/angular/index.d.ts +0 -357
- package/dist/types/index.d.ts +0 -644
- package/dist/types/react/index.d.ts +0 -345
- package/dist/types/remix/index.d.ts +0 -336
- package/dist/types/svelte/index.d.ts +0 -322
- package/dist/types/wizard/index.d.ts +0 -523
- package/readme.md +0 -335
- package/rollup.config.js +0 -422
- package/simple-spa.html +0 -1000
- package/src/angular/index.ts +0 -79
- package/src/api.ts +0 -416
- package/src/index.ts +0 -35
- package/src/react/AutoInstallWizard.tsx +0 -557
- package/src/react/browser.ts +0 -8
- package/src/react/index.tsx +0 -308
- package/src/redact.ts +0 -327
- package/src/remix/index.ts +0 -16
- package/src/svelte/index.ts +0 -14
- package/src/tracker.ts +0 -1587
- package/src/types/clack.d.ts +0 -31
- package/src/utils/ip-detector.ts +0 -158
- package/src/utils/logger.ts +0 -144
- package/src/utils/property-detector.ts +0 -345
- package/src/utils/property-manager.ts +0 -274
- package/src/vue/index.ts +0 -29
- package/src/wizard/README.md +0 -114
- package/src/wizard/ai/ai-install-wizard.ts +0 -897
- package/src/wizard/ai/manual-framework-wizard.ts +0 -238
- package/src/wizard/cli/ai-auto-install.ts +0 -241
- package/src/wizard/cli/auto-install.ts +0 -224
- package/src/wizard/core/install-wizard.ts +0 -1794
- package/src/wizard/index.ts +0 -23
- package/src/wizard/services/centralized-ai-service.ts +0 -668
- package/src/wizard/services/remote-ai-service.ts +0 -240
- package/tsconfig.json +0 -24
package/README.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# HumanBehavior JS - Modular Edition
|
|
2
|
+
|
|
3
|
+
This is the modular version of the HumanBehavior JavaScript SDK, organized into separate packages for better maintainability and tree-shaking.
|
|
4
|
+
|
|
5
|
+
## Package Structure
|
|
6
|
+
|
|
7
|
+
### Core Packages
|
|
8
|
+
|
|
9
|
+
- **`@humanbehavior/core`** - Core SDK functionality (tracker, API, utilities)
|
|
10
|
+
- **`humanbehavior-js`** - Main browser SDK (re-exports from core)
|
|
11
|
+
|
|
12
|
+
### Framework Integrations
|
|
13
|
+
|
|
14
|
+
- **`@humanbehavior/react`** - React integration with hooks and context
|
|
15
|
+
- **`@humanbehavior/vue`** - Vue.js plugin
|
|
16
|
+
- **`@humanbehavior/svelte`** - Svelte integration
|
|
17
|
+
- **`@humanbehavior/remix`** - Remix.js integration
|
|
18
|
+
- **`@humanbehavior/angular`** - Angular integration
|
|
19
|
+
|
|
20
|
+
### Tools
|
|
21
|
+
|
|
22
|
+
- **`@humanbehavior/wizard`** - Installation wizard and CLI tools
|
|
23
|
+
|
|
24
|
+
### Tooling
|
|
25
|
+
|
|
26
|
+
- **`@humanbehavior-tooling/tsconfig-base`** - Shared TypeScript configuration
|
|
27
|
+
- **`@humanbehavior-tooling/rollup-utils`** - Shared Rollup build utilities
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
### Main SDK
|
|
32
|
+
```bash
|
|
33
|
+
npm install humanbehavior-js
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Framework-specific packages
|
|
37
|
+
```bash
|
|
38
|
+
# React
|
|
39
|
+
npm install @humanbehavior/react
|
|
40
|
+
|
|
41
|
+
# Vue
|
|
42
|
+
npm install @humanbehavior/vue
|
|
43
|
+
|
|
44
|
+
# Svelte
|
|
45
|
+
npm install @humanbehavior/svelte
|
|
46
|
+
|
|
47
|
+
# Remix
|
|
48
|
+
npm install @humanbehavior/remix
|
|
49
|
+
|
|
50
|
+
# Angular
|
|
51
|
+
npm install @humanbehavior/angular
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
### Basic Usage (Browser)
|
|
57
|
+
```javascript
|
|
58
|
+
import { HumanBehaviorTracker } from 'humanbehavior-js';
|
|
59
|
+
|
|
60
|
+
const tracker = HumanBehaviorTracker.init('your-api-key');
|
|
61
|
+
tracker.start();
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### React Integration
|
|
65
|
+
```jsx
|
|
66
|
+
import { HumanBehaviorProvider, useHumanBehavior } from '@humanbehavior/react';
|
|
67
|
+
|
|
68
|
+
function App() {
|
|
69
|
+
return (
|
|
70
|
+
<HumanBehaviorProvider apiKey="your-api-key">
|
|
71
|
+
<YourApp />
|
|
72
|
+
</HumanBehaviorProvider>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Vue Integration
|
|
78
|
+
```javascript
|
|
79
|
+
import { createApp } from 'vue';
|
|
80
|
+
import { HumanBehaviorPlugin } from '@humanbehavior/vue';
|
|
81
|
+
|
|
82
|
+
const app = createApp(App);
|
|
83
|
+
app.use(HumanBehaviorPlugin, {
|
|
84
|
+
apiKey: 'your-api-key'
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Svelte Integration
|
|
89
|
+
```javascript
|
|
90
|
+
import { humanBehaviorStore } from '@humanbehavior/svelte';
|
|
91
|
+
|
|
92
|
+
const tracker = humanBehaviorStore.init('your-api-key');
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
### Setup
|
|
98
|
+
```bash
|
|
99
|
+
npm install
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Build all packages
|
|
103
|
+
```bash
|
|
104
|
+
npm run build
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Build specific package
|
|
108
|
+
```bash
|
|
109
|
+
npm run build --workspace=@humanbehavior/core
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Development mode
|
|
113
|
+
```bash
|
|
114
|
+
npm run dev
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Architecture
|
|
118
|
+
|
|
119
|
+
This modular structure provides several benefits:
|
|
120
|
+
|
|
121
|
+
1. **Tree-shaking**: Only import what you need
|
|
122
|
+
2. **Framework-specific optimizations**: Each framework package is optimized for its target
|
|
123
|
+
3. **Better maintainability**: Clear separation of concerns
|
|
124
|
+
4. **Reduced bundle size**: Smaller packages for specific use cases
|
|
125
|
+
5. **Easier testing**: Isolated packages are easier to test
|
|
126
|
+
|
|
127
|
+
## Migration from v1
|
|
128
|
+
|
|
129
|
+
The API remains the same, but the import paths have changed:
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
// Old
|
|
133
|
+
import { HumanBehaviorTracker } from 'humanbehavior-js';
|
|
134
|
+
|
|
135
|
+
// New
|
|
136
|
+
import { HumanBehaviorTracker } from 'humanbehavior-js';
|
|
137
|
+
// or for framework-specific packages
|
|
138
|
+
import { HumanBehaviorProvider } from '@humanbehavior/react';
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Contributing
|
|
142
|
+
|
|
143
|
+
1. Fork the repository
|
|
144
|
+
2. Create a feature branch
|
|
145
|
+
3. Make your changes
|
|
146
|
+
4. Add tests
|
|
147
|
+
5. Submit a pull request
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,95 +1,138 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "humanbehavior-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "SDK for HumanBehavior session and event recording",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
"private": false,
|
|
6
|
+
"packageManager": "npm@10.0.0",
|
|
7
|
+
"workspaces": [
|
|
8
|
+
"packages/*",
|
|
9
|
+
"tooling/*"
|
|
10
|
+
],
|
|
11
|
+
"main": "packages/browser/dist/index.js",
|
|
12
|
+
"module": "packages/browser/dist/index.mjs",
|
|
13
|
+
"types": "packages/browser/dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"packages/browser/dist",
|
|
16
|
+
"packages/react/dist",
|
|
17
|
+
"packages/vue/dist",
|
|
18
|
+
"packages/svelte/dist",
|
|
19
|
+
"packages/remix/dist",
|
|
20
|
+
"packages/angular/dist",
|
|
21
|
+
"packages/wizard/dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"typesVersions": {
|
|
25
|
+
"*": {
|
|
26
|
+
"react": [
|
|
27
|
+
"./packages/react/dist/index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"svelte": [
|
|
30
|
+
"./packages/svelte/dist/index.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"vue": [
|
|
33
|
+
"./packages/vue/dist/index.d.ts"
|
|
34
|
+
],
|
|
35
|
+
"remix": [
|
|
36
|
+
"./packages/remix/dist/index.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"angular": [
|
|
39
|
+
"./packages/angular/dist/index.d.ts"
|
|
40
|
+
],
|
|
41
|
+
"wizard": [
|
|
42
|
+
"./packages/wizard/dist/index.d.ts"
|
|
43
|
+
],
|
|
44
|
+
"install-wizard": [
|
|
45
|
+
"./packages/wizard/dist/index.d.ts"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
11
49
|
"exports": {
|
|
12
50
|
".": {
|
|
13
|
-
"import": "./dist/
|
|
14
|
-
"require": "./dist/
|
|
15
|
-
"types": "./dist/
|
|
51
|
+
"import": "./packages/browser/dist/index.mjs",
|
|
52
|
+
"require": "./packages/browser/dist/index.js",
|
|
53
|
+
"types": "./packages/browser/dist/index.d.ts"
|
|
16
54
|
},
|
|
17
55
|
"./react": {
|
|
18
|
-
"import": "./
|
|
19
|
-
"require": "./
|
|
20
|
-
"types": "./
|
|
56
|
+
"import": "./packages/react/dist/index.mjs",
|
|
57
|
+
"require": "./packages/react/dist/index.js",
|
|
58
|
+
"types": "./packages/react/dist/index.d.ts"
|
|
21
59
|
},
|
|
22
|
-
"./
|
|
23
|
-
"import": "./
|
|
24
|
-
"require": "./
|
|
25
|
-
"types": "./
|
|
60
|
+
"./react/index": {
|
|
61
|
+
"import": "./packages/react/dist/index.mjs",
|
|
62
|
+
"require": "./packages/react/dist/index.js",
|
|
63
|
+
"types": "./packages/react/dist/index.d.ts"
|
|
26
64
|
},
|
|
27
65
|
"./vue": {
|
|
28
|
-
"import": "./
|
|
29
|
-
"require": "./
|
|
30
|
-
"types": "./
|
|
66
|
+
"import": "./packages/vue/dist/index.mjs",
|
|
67
|
+
"require": "./packages/vue/dist/index.js",
|
|
68
|
+
"types": "./packages/vue/dist/index.d.ts"
|
|
69
|
+
},
|
|
70
|
+
"./svelte": {
|
|
71
|
+
"import": "./packages/svelte/dist/index.mjs",
|
|
72
|
+
"require": "./packages/svelte/dist/index.js",
|
|
73
|
+
"types": "./packages/svelte/dist/index.d.ts"
|
|
31
74
|
},
|
|
32
75
|
"./remix": {
|
|
33
|
-
"import": "./
|
|
34
|
-
"require": "./
|
|
35
|
-
"types": "./
|
|
76
|
+
"import": "./packages/remix/dist/index.mjs",
|
|
77
|
+
"require": "./packages/remix/dist/index.js",
|
|
78
|
+
"types": "./packages/remix/dist/index.d.ts"
|
|
36
79
|
},
|
|
37
80
|
"./angular": {
|
|
38
|
-
"import": "./
|
|
39
|
-
"require": "./
|
|
40
|
-
"types": "./
|
|
41
|
-
},
|
|
42
|
-
"./install-wizard": {
|
|
43
|
-
"import": "./dist/esm/install-wizard.js",
|
|
44
|
-
"require": "./dist/cjs/install-wizard.cjs",
|
|
45
|
-
"types": "./dist/types/install-wizard.d.ts"
|
|
81
|
+
"import": "./packages/angular/dist/index.mjs",
|
|
82
|
+
"require": "./packages/angular/dist/index.js",
|
|
83
|
+
"types": "./packages/angular/dist/index.d.ts"
|
|
46
84
|
},
|
|
47
85
|
"./wizard": {
|
|
48
|
-
"import": "./
|
|
49
|
-
"require": "./
|
|
50
|
-
"types": "./
|
|
86
|
+
"import": "./packages/wizard/dist/index.mjs",
|
|
87
|
+
"require": "./packages/wizard/dist/index.js",
|
|
88
|
+
"types": "./packages/wizard/dist/index.d.ts"
|
|
89
|
+
},
|
|
90
|
+
"./install-wizard": {
|
|
91
|
+
"import": "./packages/wizard/dist/index.mjs",
|
|
92
|
+
"require": "./packages/wizard/dist/index.js",
|
|
93
|
+
"types": "./packages/wizard/dist/index.d.ts"
|
|
51
94
|
}
|
|
52
95
|
},
|
|
53
96
|
"scripts": {
|
|
54
|
-
"build": "
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"license": "ISC",
|
|
62
|
-
"dependencies": {
|
|
63
|
-
"@clack/prompts": "^0.11.0",
|
|
64
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
65
|
-
"@rrweb/record": "^2.0.0-alpha.17",
|
|
66
|
-
"@rrweb/types": "^2.0.0-alpha.17",
|
|
67
|
-
"@types/react": "^19.0.12",
|
|
68
|
-
"openai": "^5.12.0",
|
|
69
|
-
"uuid": "^11.1.0"
|
|
70
|
-
},
|
|
71
|
-
"peerDependencies": {
|
|
72
|
-
"@remix-run/node": ">=2.0.0",
|
|
73
|
-
"react": ">=16.8.0",
|
|
74
|
-
"react-dom": ">=16.8.0",
|
|
75
|
-
"vue": ">=3.0.0"
|
|
97
|
+
"build": "turbo build",
|
|
98
|
+
"dev": "turbo dev",
|
|
99
|
+
"clean": "turbo clean",
|
|
100
|
+
"lint": "turbo lint",
|
|
101
|
+
"lint:fix": "turbo lint:fix",
|
|
102
|
+
"test": "turbo test",
|
|
103
|
+
"package": "turbo package"
|
|
76
104
|
},
|
|
77
105
|
"devDependencies": {
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
106
|
+
"@changesets/changelog-github": "^0.5.1",
|
|
107
|
+
"@changesets/cli": "^2.29.5",
|
|
108
|
+
"@types/eslint": "^8.44.6",
|
|
109
|
+
"@types/jest": "^28.1.5",
|
|
110
|
+
"@types/node": "^22.17.0",
|
|
111
|
+
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
112
|
+
"@typescript-eslint/parser": "^8.29.1",
|
|
113
|
+
"eslint": "8.57.0",
|
|
114
|
+
"eslint-config-prettier": "^8.5.0",
|
|
115
|
+
"eslint-plugin-compat": "^6.0.1",
|
|
116
|
+
"eslint-plugin-jest": "^28.8.3",
|
|
117
|
+
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
118
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
119
|
+
"eslint-plugin-react": "^7.30.1",
|
|
120
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
121
|
+
"lint-staged": "^10.2.11",
|
|
122
|
+
"rimraf": "^6.0.1",
|
|
123
|
+
"turbo": "^2.5.4",
|
|
124
|
+
"typescript": "^5.8.2"
|
|
89
125
|
},
|
|
90
|
-
"
|
|
91
|
-
"
|
|
126
|
+
"lint-staged": {
|
|
127
|
+
"*.{ts,tsx,js,jsx,mjs,cjs}": [
|
|
128
|
+
"eslint --cache --fix",
|
|
129
|
+
"prettier --write"
|
|
130
|
+
],
|
|
131
|
+
"*.{json,md}": "prettier --write"
|
|
92
132
|
},
|
|
133
|
+
"author": "Chirag Kawediya, Skyler Ji, Amogh Chaturvedi",
|
|
134
|
+
"license": "ISC",
|
|
135
|
+
"homepage": "https://documentation.humanbehavior.co",
|
|
93
136
|
"repository": {
|
|
94
137
|
"type": "git",
|
|
95
138
|
"url": "git+https://github.com/humanbehavior-gh/humanbehavior-js.git"
|
|
@@ -100,7 +143,7 @@
|
|
|
100
143
|
"rrweb",
|
|
101
144
|
"koalaware"
|
|
102
145
|
],
|
|
103
|
-
"
|
|
104
|
-
"
|
|
146
|
+
"publishConfig": {
|
|
147
|
+
"access": "public"
|
|
105
148
|
}
|
|
106
149
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HumanBehaviorTracker } from '@humanbehavior/core';
|
|
2
|
+
export declare class HumanBehaviorModule {
|
|
3
|
+
static forRoot(config: {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
ingestionUrl?: string;
|
|
6
|
+
logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';
|
|
7
|
+
redactFields?: string[];
|
|
8
|
+
suppressConsoleErrors?: boolean;
|
|
9
|
+
recordCanvas?: boolean;
|
|
10
|
+
}): {
|
|
11
|
+
ngModule: typeof HumanBehaviorModule;
|
|
12
|
+
providers: ({
|
|
13
|
+
provide: string;
|
|
14
|
+
useValue: string;
|
|
15
|
+
useFactory?: undefined;
|
|
16
|
+
deps?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
provide: typeof HumanBehaviorTracker;
|
|
19
|
+
useFactory: (apiKey: string) => HumanBehaviorTracker;
|
|
20
|
+
deps: string[];
|
|
21
|
+
useValue?: undefined;
|
|
22
|
+
})[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare class HumanBehaviorService {
|
|
26
|
+
private tracker;
|
|
27
|
+
constructor(apiKey: string, options?: {
|
|
28
|
+
ingestionUrl?: string;
|
|
29
|
+
logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';
|
|
30
|
+
redactFields?: string[];
|
|
31
|
+
suppressConsoleErrors?: boolean;
|
|
32
|
+
recordCanvas?: boolean;
|
|
33
|
+
});
|
|
34
|
+
identifyUser(userProperties: Record<string, any>): Promise<string>;
|
|
35
|
+
getSessionId(): string;
|
|
36
|
+
setUnredactedFields(fields: string[]): void;
|
|
37
|
+
getUnredactedFields(): string[];
|
|
38
|
+
}
|
|
39
|
+
export declare function initializeHumanBehavior(apiKey: string, options?: {
|
|
40
|
+
ingestionUrl?: string;
|
|
41
|
+
logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';
|
|
42
|
+
redactFields?: string[];
|
|
43
|
+
suppressConsoleErrors?: boolean;
|
|
44
|
+
recordCanvas?: boolean;
|
|
45
|
+
}): HumanBehaviorTracker;
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QACxD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;;;;;;;;;iCAU4B,MAAM;;;;;CAcpC;AAGD,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,OAAO,CAAuB;gBAE1B,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QACpC,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QACxD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;IAKD,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAIhD,YAAY;IAIZ,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE;IAIpC,mBAAmB;CAGpB;AAGD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,oBAAoB,CAEvB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("@humanbehavior/core");class r{static forRoot(s){return{ngModule:r,providers:[{provide:"HUMANBEHAVIOR_API_KEY",useValue:s.apiKey},{provide:e.HumanBehaviorTracker,useFactory:r=>e.HumanBehaviorTracker.init(r,{ingestionUrl:s.ingestionUrl,logLevel:s.logLevel,redactFields:s.redactFields,suppressConsoleErrors:s.suppressConsoleErrors,recordCanvas:s.recordCanvas}),deps:["HUMANBEHAVIOR_API_KEY"]}]}}}exports.HumanBehaviorModule=r,exports.HumanBehaviorService=class{constructor(r,s){this.tracker=e.HumanBehaviorTracker.init(r,s)}identifyUser(e){return this.tracker.identifyUser({userProperties:e})}getSessionId(){return this.tracker.getSessionId()}setUnredactedFields(e){return this.tracker.setUnredactedFields(e)}getUnredactedFields(){return this.tracker.getUnredactedFields()}},exports.initializeHumanBehavior=function(r,s){return e.HumanBehaviorTracker.init(r,s)};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { HumanBehaviorTracker } from '@humanbehavior/core';\n\n// Angular NgModule for legacy Angular applications\nexport class HumanBehaviorModule {\n static forRoot(config: { \n apiKey: string;\n ingestionUrl?: string;\n logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';\n redactFields?: string[];\n suppressConsoleErrors?: boolean;\n recordCanvas?: boolean; // Enable canvas recording with protection\n }) {\n return {\n ngModule: HumanBehaviorModule,\n providers: [\n {\n provide: 'HUMANBEHAVIOR_API_KEY',\n useValue: config.apiKey\n },\n {\n provide: HumanBehaviorTracker,\n useFactory: (apiKey: string) => {\n return HumanBehaviorTracker.init(apiKey, {\n ingestionUrl: config.ingestionUrl,\n logLevel: config.logLevel,\n redactFields: config.redactFields,\n suppressConsoleErrors: config.suppressConsoleErrors,\n recordCanvas: config.recordCanvas, // Pass canvas recording option\n });\n },\n deps: ['HUMANBEHAVIOR_API_KEY']\n }\n ]\n };\n }\n}\n\n// Angular service for dependency injection\nexport class HumanBehaviorService {\n private tracker: HumanBehaviorTracker;\n\n constructor(apiKey: string, options?: {\n ingestionUrl?: string;\n logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';\n redactFields?: string[];\n suppressConsoleErrors?: boolean;\n recordCanvas?: boolean; // Enable canvas recording with protection\n }) {\n this.tracker = HumanBehaviorTracker.init(apiKey, options);\n }\n\n // Expose core tracker methods\n identifyUser(userProperties: Record<string, any>) {\n return this.tracker.identifyUser({ userProperties });\n }\n\n getSessionId() {\n return this.tracker.getSessionId();\n }\n\n setUnredactedFields(fields: string[]) {\n return this.tracker.setUnredactedFields(fields);\n }\n\n getUnredactedFields() {\n return this.tracker.getUnredactedFields();\n }\n}\n\n// Helper function for standalone Angular initialization\nexport function initializeHumanBehavior(apiKey: string, options?: {\n ingestionUrl?: string;\n logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';\n redactFields?: string[];\n suppressConsoleErrors?: boolean;\n recordCanvas?: boolean; // Enable canvas recording with protection\n}): HumanBehaviorTracker {\n return HumanBehaviorTracker.init(apiKey, options);\n} "],"names":["HumanBehaviorModule","forRoot","config","ngModule","providers","provide","useValue","apiKey","HumanBehaviorTracker","useFactory","init","ingestionUrl","logLevel","redactFields","suppressConsoleErrors","recordCanvas","deps","constructor","options","this","tracker","identifyUser","userProperties","getSessionId","setUnredactedFields","fields","getUnredactedFields"],"mappings":"wDAGaA,EACX,cAAOC,CAAQC,GAQb,MAAO,CACLC,SAAUH,EACVI,UAAW,CACT,CACEC,QAAS,wBACTC,SAAUJ,EAAOK,QAEnB,CACEF,QAASG,EAAAA,qBACTC,WAAaF,GACJC,EAAAA,qBAAqBE,KAAKH,EAAQ,CACvCI,aAAcT,EAAOS,aACrBC,SAAUV,EAAOU,SACjBC,aAAcX,EAAOW,aACrBC,sBAAuBZ,EAAOY,sBAC9BC,aAAcb,EAAOa,eAGzBC,KAAM,CAAC,2BAIf,mEAOA,WAAAC,CAAYV,EAAgBW,GAO1BC,KAAKC,QAAUZ,EAAAA,qBAAqBE,KAAKH,EAAQW,EACnD,CAGA,YAAAG,CAAaC,GACX,OAAOH,KAAKC,QAAQC,aAAa,CAAEC,kBACrC,CAEA,YAAAC,GACE,OAAOJ,KAAKC,QAAQG,cACtB,CAEA,mBAAAC,CAAoBC,GAClB,OAAON,KAAKC,QAAQI,oBAAoBC,EAC1C,CAEA,mBAAAC,GACE,OAAOP,KAAKC,QAAQM,qBACtB,mCAII,SAAkCnB,EAAgBW,GAOtD,OAAOV,uBAAqBE,KAAKH,EAAQW,EAC3C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{HumanBehaviorTracker as e}from"@humanbehavior/core";class r{static forRoot(s){return{ngModule:r,providers:[{provide:"HUMANBEHAVIOR_API_KEY",useValue:s.apiKey},{provide:e,useFactory:r=>e.init(r,{ingestionUrl:s.ingestionUrl,logLevel:s.logLevel,redactFields:s.redactFields,suppressConsoleErrors:s.suppressConsoleErrors,recordCanvas:s.recordCanvas}),deps:["HUMANBEHAVIOR_API_KEY"]}]}}}class s{constructor(r,s){this.tracker=e.init(r,s)}identifyUser(e){return this.tracker.identifyUser({userProperties:e})}getSessionId(){return this.tracker.getSessionId()}setUnredactedFields(e){return this.tracker.setUnredactedFields(e)}getUnredactedFields(){return this.tracker.getUnredactedFields()}}function t(r,s){return e.init(r,s)}export{r as HumanBehaviorModule,s as HumanBehaviorService,t as initializeHumanBehavior};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { HumanBehaviorTracker } from '@humanbehavior/core';\n\n// Angular NgModule for legacy Angular applications\nexport class HumanBehaviorModule {\n static forRoot(config: { \n apiKey: string;\n ingestionUrl?: string;\n logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';\n redactFields?: string[];\n suppressConsoleErrors?: boolean;\n recordCanvas?: boolean; // Enable canvas recording with protection\n }) {\n return {\n ngModule: HumanBehaviorModule,\n providers: [\n {\n provide: 'HUMANBEHAVIOR_API_KEY',\n useValue: config.apiKey\n },\n {\n provide: HumanBehaviorTracker,\n useFactory: (apiKey: string) => {\n return HumanBehaviorTracker.init(apiKey, {\n ingestionUrl: config.ingestionUrl,\n logLevel: config.logLevel,\n redactFields: config.redactFields,\n suppressConsoleErrors: config.suppressConsoleErrors,\n recordCanvas: config.recordCanvas, // Pass canvas recording option\n });\n },\n deps: ['HUMANBEHAVIOR_API_KEY']\n }\n ]\n };\n }\n}\n\n// Angular service for dependency injection\nexport class HumanBehaviorService {\n private tracker: HumanBehaviorTracker;\n\n constructor(apiKey: string, options?: {\n ingestionUrl?: string;\n logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';\n redactFields?: string[];\n suppressConsoleErrors?: boolean;\n recordCanvas?: boolean; // Enable canvas recording with protection\n }) {\n this.tracker = HumanBehaviorTracker.init(apiKey, options);\n }\n\n // Expose core tracker methods\n identifyUser(userProperties: Record<string, any>) {\n return this.tracker.identifyUser({ userProperties });\n }\n\n getSessionId() {\n return this.tracker.getSessionId();\n }\n\n setUnredactedFields(fields: string[]) {\n return this.tracker.setUnredactedFields(fields);\n }\n\n getUnredactedFields() {\n return this.tracker.getUnredactedFields();\n }\n}\n\n// Helper function for standalone Angular initialization\nexport function initializeHumanBehavior(apiKey: string, options?: {\n ingestionUrl?: string;\n logLevel?: 'none' | 'error' | 'warn' | 'info' | 'debug';\n redactFields?: string[];\n suppressConsoleErrors?: boolean;\n recordCanvas?: boolean; // Enable canvas recording with protection\n}): HumanBehaviorTracker {\n return HumanBehaviorTracker.init(apiKey, options);\n} "],"names":["HumanBehaviorModule","forRoot","config","ngModule","providers","provide","useValue","apiKey","HumanBehaviorTracker","useFactory","init","ingestionUrl","logLevel","redactFields","suppressConsoleErrors","recordCanvas","deps","HumanBehaviorService","constructor","options","this","tracker","identifyUser","userProperties","getSessionId","setUnredactedFields","fields","getUnredactedFields","initializeHumanBehavior"],"mappings":"iEAGaA,EACX,cAAOC,CAAQC,GAQb,MAAO,CACLC,SAAUH,EACVI,UAAW,CACT,CACEC,QAAS,wBACTC,SAAUJ,EAAOK,QAEnB,CACEF,QAASG,EACTC,WAAaF,GACJC,EAAqBE,KAAKH,EAAQ,CACvCI,aAAcT,EAAOS,aACrBC,SAAUV,EAAOU,SACjBC,aAAcX,EAAOW,aACrBC,sBAAuBZ,EAAOY,sBAC9BC,aAAcb,EAAOa,eAGzBC,KAAM,CAAC,2BAIf,QAIWC,EAGX,WAAAC,CAAYX,EAAgBY,GAO1BC,KAAKC,QAAUb,EAAqBE,KAAKH,EAAQY,EACnD,CAGA,YAAAG,CAAaC,GACX,OAAOH,KAAKC,QAAQC,aAAa,CAAEC,kBACrC,CAEA,YAAAC,GACE,OAAOJ,KAAKC,QAAQG,cACtB,CAEA,mBAAAC,CAAoBC,GAClB,OAAON,KAAKC,QAAQI,oBAAoBC,EAC1C,CAEA,mBAAAC,GACE,OAAOP,KAAKC,QAAQM,qBACtB,EAII,SAAUC,EAAwBrB,EAAgBY,GAOtD,OAAOX,EAAqBE,KAAKH,EAAQY,EAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,cAAc,qBAAqB,CAAC"}
|