humanbehavior-js 0.4.28 → 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.
Files changed (140) hide show
  1. package/README.md +151 -0
  2. package/package.json +114 -79
  3. package/packages/angular/dist/index.d.ts +46 -0
  4. package/packages/angular/dist/index.d.ts.map +1 -0
  5. package/packages/angular/dist/index.js +2 -0
  6. package/packages/angular/dist/index.js.map +1 -0
  7. package/packages/angular/dist/index.mjs +2 -0
  8. package/packages/angular/dist/index.mjs.map +1 -0
  9. package/packages/browser/dist/index.d.ts +5 -0
  10. package/packages/browser/dist/index.d.ts.map +1 -0
  11. package/packages/browser/dist/index.iife.js +12095 -0
  12. package/packages/browser/dist/index.iife.js.map +1 -0
  13. package/packages/browser/dist/index.js +2 -0
  14. package/packages/browser/dist/index.js.map +1 -0
  15. package/packages/browser/dist/index.min.js +2 -0
  16. package/packages/browser/dist/index.min.js.map +1 -0
  17. package/packages/browser/dist/index.mjs +2 -0
  18. package/packages/browser/dist/index.mjs.map +1 -0
  19. package/packages/react/dist/browser.d.ts +2 -0
  20. package/packages/react/dist/browser.d.ts.map +1 -0
  21. package/packages/react/dist/index.d.ts +48 -0
  22. package/packages/react/dist/index.d.ts.map +1 -0
  23. package/packages/react/dist/index.js +2 -0
  24. package/packages/react/dist/index.js.map +1 -0
  25. package/packages/react/dist/index.mjs +2 -0
  26. package/packages/react/dist/index.mjs.map +1 -0
  27. package/packages/remix/dist/index.d.ts +8 -0
  28. package/packages/remix/dist/index.d.ts.map +1 -0
  29. package/packages/remix/dist/index.js +2 -0
  30. package/packages/remix/dist/index.js.map +1 -0
  31. package/packages/remix/dist/index.mjs +2 -0
  32. package/packages/remix/dist/index.mjs.map +1 -0
  33. package/packages/svelte/dist/index.d.ts +11 -0
  34. package/packages/svelte/dist/index.d.ts.map +1 -0
  35. package/packages/svelte/dist/index.js +2 -0
  36. package/packages/svelte/dist/index.js.map +1 -0
  37. package/packages/svelte/dist/index.mjs +2 -0
  38. package/packages/svelte/dist/index.mjs.map +1 -0
  39. package/{dist/types/vue → packages/vue/dist}/index.d.ts +4 -5
  40. package/packages/vue/dist/index.d.ts.map +1 -0
  41. package/packages/vue/dist/index.js +2 -0
  42. package/packages/vue/dist/index.js.map +1 -0
  43. package/packages/vue/dist/index.mjs +2 -0
  44. package/packages/vue/dist/index.mjs.map +1 -0
  45. package/packages/wizard/dist/ai/ai-install-wizard.d.ts +145 -0
  46. package/packages/wizard/dist/ai/ai-install-wizard.d.ts.map +1 -0
  47. package/packages/wizard/dist/ai/manual-framework-wizard.d.ts +52 -0
  48. package/packages/wizard/dist/ai/manual-framework-wizard.d.ts.map +1 -0
  49. package/packages/wizard/dist/cli/ai-auto-install.d.ts +27 -0
  50. package/packages/wizard/dist/cli/ai-auto-install.d.ts.map +1 -0
  51. package/{dist → packages/wizard/dist}/cli/ai-auto-install.js +821 -905
  52. package/packages/wizard/dist/cli/ai-auto-install.js.map +1 -0
  53. package/packages/wizard/dist/cli/auto-install.d.ts +26 -0
  54. package/packages/wizard/dist/cli/auto-install.d.ts.map +1 -0
  55. package/{dist → packages/wizard/dist}/cli/auto-install.js +821 -905
  56. package/packages/wizard/dist/cli/auto-install.js.map +1 -0
  57. package/{dist/types → packages/wizard/dist/core}/install-wizard.d.ts +6 -8
  58. package/packages/wizard/dist/core/install-wizard.d.ts.map +1 -0
  59. package/packages/wizard/dist/index.d.ts +18 -0
  60. package/packages/wizard/dist/index.d.ts.map +1 -0
  61. package/packages/wizard/dist/index.js +2 -0
  62. package/packages/wizard/dist/index.js.map +1 -0
  63. package/packages/wizard/dist/index.mjs +2 -0
  64. package/packages/wizard/dist/index.mjs.map +1 -0
  65. package/packages/wizard/dist/services/centralized-ai-service.d.ts +159 -0
  66. package/packages/wizard/dist/services/centralized-ai-service.d.ts.map +1 -0
  67. package/packages/wizard/dist/services/remote-ai-service.d.ts +58 -0
  68. package/packages/wizard/dist/services/remote-ai-service.d.ts.map +1 -0
  69. package/WIZARD_USAGE_GUIDE.md +0 -381
  70. package/dist/cjs/angular/index.cjs +0 -14979
  71. package/dist/cjs/angular/index.cjs.map +0 -1
  72. package/dist/cjs/index.cjs +0 -14964
  73. package/dist/cjs/index.cjs.map +0 -1
  74. package/dist/cjs/install-wizard.cjs +0 -1576
  75. package/dist/cjs/install-wizard.cjs.map +0 -1
  76. package/dist/cjs/react/index.cjs +0 -15103
  77. package/dist/cjs/react/index.cjs.map +0 -1
  78. package/dist/cjs/remix/index.cjs +0 -15077
  79. package/dist/cjs/remix/index.cjs.map +0 -1
  80. package/dist/cjs/svelte/index.cjs +0 -14933
  81. package/dist/cjs/svelte/index.cjs.map +0 -1
  82. package/dist/cjs/vue/index.cjs +0 -14942
  83. package/dist/cjs/vue/index.cjs.map +0 -1
  84. package/dist/cjs/wizard/index.cjs +0 -3490
  85. package/dist/cjs/wizard/index.cjs.map +0 -1
  86. package/dist/cli/ai-auto-install.js.map +0 -1
  87. package/dist/cli/auto-install.js.map +0 -1
  88. package/dist/esm/angular/index.js +0 -14975
  89. package/dist/esm/angular/index.js.map +0 -1
  90. package/dist/esm/index.js +0 -14941
  91. package/dist/esm/index.js.map +0 -1
  92. package/dist/esm/install-wizard.js +0 -1553
  93. package/dist/esm/install-wizard.js.map +0 -1
  94. package/dist/esm/react/index.js +0 -15097
  95. package/dist/esm/react/index.js.map +0 -1
  96. package/dist/esm/remix/index.js +0 -15073
  97. package/dist/esm/remix/index.js.map +0 -1
  98. package/dist/esm/svelte/index.js +0 -14931
  99. package/dist/esm/svelte/index.js.map +0 -1
  100. package/dist/esm/vue/index.js +0 -14940
  101. package/dist/esm/vue/index.js.map +0 -1
  102. package/dist/esm/wizard/index.js +0 -3459
  103. package/dist/esm/wizard/index.js.map +0 -1
  104. package/dist/index.min.js +0 -2
  105. package/dist/index.min.js.map +0 -1
  106. package/dist/types/angular/index.d.ts +0 -357
  107. package/dist/types/index.d.ts +0 -644
  108. package/dist/types/react/index.d.ts +0 -345
  109. package/dist/types/remix/index.d.ts +0 -336
  110. package/dist/types/svelte/index.d.ts +0 -322
  111. package/dist/types/wizard/index.d.ts +0 -523
  112. package/readme.md +0 -335
  113. package/rollup.config.js +0 -422
  114. package/simple-spa.html +0 -1000
  115. package/src/angular/index.ts +0 -79
  116. package/src/api.ts +0 -416
  117. package/src/index.ts +0 -35
  118. package/src/react/AutoInstallWizard.tsx +0 -557
  119. package/src/react/browser.ts +0 -8
  120. package/src/react/index.tsx +0 -308
  121. package/src/redact.ts +0 -327
  122. package/src/remix/index.ts +0 -16
  123. package/src/svelte/index.ts +0 -14
  124. package/src/tracker.ts +0 -1587
  125. package/src/types/clack.d.ts +0 -31
  126. package/src/utils/ip-detector.ts +0 -158
  127. package/src/utils/logger.ts +0 -144
  128. package/src/utils/property-detector.ts +0 -345
  129. package/src/utils/property-manager.ts +0 -274
  130. package/src/vue/index.ts +0 -29
  131. package/src/wizard/README.md +0 -114
  132. package/src/wizard/ai/ai-install-wizard.ts +0 -897
  133. package/src/wizard/ai/manual-framework-wizard.ts +0 -238
  134. package/src/wizard/cli/ai-auto-install.ts +0 -241
  135. package/src/wizard/cli/auto-install.ts +0 -224
  136. package/src/wizard/core/install-wizard.ts +0 -1794
  137. package/src/wizard/index.ts +0 -23
  138. package/src/wizard/services/centralized-ai-service.ts +0 -668
  139. package/src/wizard/services/remote-ai-service.ts +0 -240
  140. 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,103 +1,138 @@
1
1
  {
2
2
  "name": "humanbehavior-js",
3
- "version": "0.4.28",
3
+ "version": "0.5.0",
4
4
  "description": "SDK for HumanBehavior session and event recording",
5
- "type": "module",
6
- "main": "./dist/cjs/index.js",
7
- "module": "./dist/esm/index.js",
8
- "types": "./dist/types/index.d.ts",
9
- "unpkg": "dist/index.min.js",
10
- "homepage": "https://documentation.humanbehavior.co",
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/esm/index.js",
14
- "require": "./dist/cjs/index.cjs",
15
- "types": "./dist/types/index.d.ts"
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": "./dist/esm/react/index.js",
19
- "require": "./dist/cjs/react/index.cjs",
20
- "types": "./dist/types/react/index.d.ts"
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
- "./svelte": {
23
- "import": "./dist/esm/svelte/index.js",
24
- "require": "./dist/cjs/svelte/index.cjs",
25
- "types": "./dist/types/svelte/index.d.ts"
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": "./dist/esm/vue/index.js",
29
- "require": "./dist/cjs/vue/index.cjs",
30
- "types": "./dist/types/vue/index.d.ts"
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": "./dist/esm/remix/index.js",
34
- "require": "./dist/cjs/remix/index.cjs",
35
- "types": "./dist/types/remix/index.d.ts"
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": "./dist/esm/angular/index.js",
39
- "require": "./dist/cjs/angular/index.cjs",
40
- "types": "./dist/types/angular/index.d.ts"
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": "./dist/esm/wizard/index.js",
49
- "require": "./dist/cjs/wizard/index.cjs",
50
- "types": "./dist/types/wizard/index.d.ts"
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": "rollup -c",
55
- "build:dev": "rollup -c --environment NODE_ENV:development",
56
- "prepare": "npm run build",
57
- "test": "echo \"Error: no test specified\" && exit 1",
58
- "auto-install": "node dist/cli/auto-install.js"
59
- },
60
- "author": "Chirag Kawediya, Skyler Ji, Amogh Chaturvedi",
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
- "optionalDependencies": {
72
- "@remix-run/node": ">=2.0.0"
73
- },
74
- "peerDependencies": {
75
- "react": ">=16.8.0",
76
- "react-dom": ">=16.8.0"
77
- },
78
- "peerDependenciesMeta": {
79
- "@remix-run/node": {
80
- "optional": true
81
- },
82
- "vue": {
83
- "optional": true
84
- }
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"
85
104
  },
86
105
  "devDependencies": {
87
- "@rollup/plugin-commonjs": "^28.0.3",
88
- "@rollup/plugin-node-resolve": "^16.0.1",
89
- "@rollup/plugin-terser": "^0.4.4",
90
- "@rollup/plugin-typescript": "^12.1.2",
91
- "@types/node": "^24.2.0",
92
- "rollup": "^4.36.0",
93
- "rollup-plugin-dts": "^6.2.1",
94
- "tslib": "^2.8.1",
95
- "typescript": ">=4.9.0",
96
- "vue": "^3.0.0"
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"
97
125
  },
98
- "publishConfig": {
99
- "access": "public"
126
+ "lint-staged": {
127
+ "*.{ts,tsx,js,jsx,mjs,cjs}": [
128
+ "eslint --cache --fix",
129
+ "prettier --write"
130
+ ],
131
+ "*.{json,md}": "prettier --write"
100
132
  },
133
+ "author": "Chirag Kawediya, Skyler Ji, Amogh Chaturvedi",
134
+ "license": "ISC",
135
+ "homepage": "https://documentation.humanbehavior.co",
101
136
  "repository": {
102
137
  "type": "git",
103
138
  "url": "git+https://github.com/humanbehavior-gh/humanbehavior-js.git"
@@ -108,7 +143,7 @@
108
143
  "rrweb",
109
144
  "koalaware"
110
145
  ],
111
- "bin": {
112
- "humanbehavior-js": "./dist/cli/ai-auto-install.js"
146
+ "publishConfig": {
147
+ "access": "public"
113
148
  }
114
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,5 @@
1
+ /**
2
+ * Main entry point for the HumanBehavior SDK
3
+ */
4
+ export * from '@humanbehavior/core';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,cAAc,qBAAqB,CAAC"}