guideai-app 0.4.3-1 → 0.4.3-2

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 (45) hide show
  1. package/dist/GuideAI.js +1 -1
  2. package/dist/GuideAI.js.map +1 -1
  3. package/dist/components/Microphone.d.ts +17 -0
  4. package/dist/components/TranscriptBox.d.ts +4 -5
  5. package/dist/components/TranscriptMessages.d.ts +8 -0
  6. package/dist/components/TranscriptTextInput.d.ts +10 -0
  7. package/dist/components/TranscriptToggle.d.ts +10 -0
  8. package/dist/index.d.ts +1 -1
  9. package/dist/metric/event-listner.d.ts +143 -0
  10. package/dist/styles/GuideAI.styles.d.ts +1 -1
  11. package/dist/types/GuideAI.types.d.ts +16 -12
  12. package/dist/utils/api.d.ts +4 -3
  13. package/dist/utils/constants.d.ts +4 -0
  14. package/dist/utils/elementInteractions.d.ts +5 -0
  15. package/dist/utils/highlightAndClick.d.ts +3 -0
  16. package/dist/utils/highlightThenClick.d.ts +2 -1
  17. package/dist/utils/hoverAndClick.d.ts +4 -0
  18. package/dist/utils/hoverThenClick.d.ts +2 -1
  19. package/dist/utils/logger.d.ts +6 -5
  20. package/package.json +4 -1
  21. package/.workflow-test +0 -1
  22. package/API_DATA_CONTRACTS.md +0 -516
  23. package/API_SESSIONID_TESTING.md +0 -215
  24. package/GuideAI.d.ts +0 -19
  25. package/GuideAI.js +0 -1
  26. package/GuideAI.js.LICENSE.txt +0 -16
  27. package/GuideAI.js.map +0 -1
  28. package/PII_HASHING_EPIC.md +0 -886
  29. package/PII_HASHING_STORIES_SUMMARY.md +0 -275
  30. package/PRODUCTION_RELEASE.md +0 -126
  31. package/SESSION_ID_VERIFICATION.md +0 -122
  32. package/VISIT_COUNT_TESTING.md +0 -453
  33. package/index.d.ts +0 -7
  34. package/jest.config.js +0 -26
  35. package/jest.setup.js +0 -21
  36. package/metadata-tracking-example.md +0 -324
  37. package/obfuscate.js +0 -40
  38. package/obfuscator.prod.json +0 -24
  39. package/rollup.config.js +0 -34
  40. package/structure.md +0 -128
  41. package/text-input-usage.md +0 -321
  42. package/transcript-toggle-usage.md +0 -267
  43. package/visit-tracking-usage.md +0 -134
  44. package/webpack.config.js +0 -55
  45. package/workflow-trigger-usage.md +0 -398
@@ -1,215 +0,0 @@
1
- # API SessionID Implementation - Testing Guide
2
-
3
- ## ✅ Implementation Complete
4
-
5
- All metadata update methods now include `sessionId` in their data payloads to comply with backend validation requirements.
6
-
7
- ## What Changed
8
-
9
- ### UserMetadataTracker Updates
10
- All 5 methods that call `addPendingUpdate()` now include `sessionId` in the data object:
11
-
12
- 1. ✅ **updateUserInfo()** - Line ~138
13
- 2. ✅ **trackLogin()** - Line ~173
14
- 3. ✅ **trackVisitIfNewSession()** - Line ~211
15
- 4. ✅ **trackVisitManually()** - Line ~274
16
- 5. ✅ **trackCustomEvent()** - Line ~311
17
-
18
- ### Event Tracking Status
19
- ⚠️ **EventTracker removed** - Event tracking has been removed from the frontend package.
20
-
21
- ## Testing Instructions
22
-
23
- ### 1. Deploy/Test the Updated Package
24
-
25
- ```bash
26
- # In testsite or wherever you're testing
27
- npm install ../guide-ai-package
28
- # or if already linked
29
- npm run dev
30
- ```
31
-
32
- ### 2. Open Browser DevTools
33
-
34
- **Chrome/Firefox:**
35
- - Press `F12` or `Cmd+Option+I` (Mac) / `Ctrl+Shift+I` (Windows)
36
- - Go to **Network** tab
37
- - Filter by: `metadata-updates` and `events`
38
-
39
- ### 3. Test /metadata-updates Endpoint
40
-
41
- #### Trigger Metadata Updates:
42
- - **Visit tracking**: Refresh the page (should trigger visit)
43
- - **Login tracking**: Call `window.GuideAI.metadata.trackLogin()`
44
- - **User info**: Call `window.GuideAI.metadata.updateUserInfo({ email: 'test@example.com' })`
45
-
46
- #### Verify Request Payload:
47
- Click on the `/metadata-updates` request in Network tab → **Payload** tab:
48
-
49
- ```json
50
- {
51
- "organizationKey": "your-org-key",
52
- "updates": [
53
- {
54
- "type": "visit",
55
- "timestamp": 1234567890,
56
- "data": {
57
- "sessionId": "550e8400-e29b-41d4-a716-446655440000", // ✅ MUST BE PRESENT
58
- "firstVisit": 1234567890,
59
- "lastVisit": 1234567890,
60
- "visitCount": 1
61
- }
62
- }
63
- ],
64
- "batchTimestamp": 1234567890,
65
- "updateCount": 1
66
- }
67
- ```
68
-
69
- #### Expected Response:
70
- - ✅ **Status: 200** (Success)
71
- - ❌ **Status: 400** (If sessionId is missing - should NOT happen)
72
-
73
- ### 4. Test /events Endpoint
74
-
75
- #### Trigger Events:
76
- - Click around the page
77
- - Focus on input fields
78
- - Submit forms
79
- - Navigate between pages
80
-
81
- #### Verify Request Payload:
82
- Click on the `/events` request in Network tab → **Payload** tab:
83
-
84
- ```json
85
- {
86
- "organizationKey": "your-org-key",
87
- "events": [
88
- {
89
- "type": "click",
90
- "timestamp": 1234567890,
91
- "url": "https://example.com/page",
92
- "sessionId": "550e8400-e29b-41d4-a716-446655440000", // ✅ MUST BE PRESENT
93
- "tagName": "BUTTON",
94
- "className": "btn-primary",
95
- "deviceType": "desktop",
96
- "userAgent": "Mozilla/5.0..."
97
- }
98
- ],
99
- "batchTimestamp": 1234567890,
100
- "eventCount": 1
101
- }
102
- ```
103
-
104
- #### Expected Response:
105
- - ✅ **Status: 200** (Success)
106
- - ❌ **Status: 400** (If sessionId is missing - should NOT happen)
107
-
108
- ## Validation Checklist
109
-
110
- ### /metadata-updates
111
- - [ ] sessionId appears in every `updates[].data` object
112
- - [ ] sessionId is a valid UUID format
113
- - [ ] sessionId matches the one in sessionStorage
114
- - [ ] API returns 200 (not 400)
115
- - [ ] Backend logs show no sessionId warnings
116
-
117
- ### /events
118
- - [ ] sessionId appears in every event object (at event level)
119
- - [ ] sessionId is a valid UUID format
120
- - [ ] sessionId matches the one in sessionStorage
121
- - [ ] API returns 200 (not 400)
122
- - [ ] Backend logs show no sessionId warnings
123
-
124
- ### Cross-Request Consistency
125
- - [ ] Same sessionId across all events in same tab
126
- - [ ] Same sessionId across all metadata updates in same tab
127
- - [ ] Different sessionId in different browser tabs
128
- - [ ] New sessionId after closing and reopening tab
129
-
130
- ## Common Issues & Solutions
131
-
132
- ### Issue: 400 Error - "sessionId is required"
133
- **Cause**: sessionId is undefined or missing from data object
134
- **Solution**:
135
- 1. Check sessionStorage has `guideai_session_id`
136
- 2. Check `this.metadata.sessionId` is set in UserMetadataTracker
137
- 3. Verify build was successful
138
-
139
- ### Issue: sessionId is "undefined" string
140
- **Cause**: sessionId not initialized before first update
141
- **Solution**: Ensure `init()` is called before any tracking methods
142
-
143
- ### Issue: sessionId changes during session
144
- **Cause**: sessionStorage being cleared
145
- **Solution**: Check for code that clears sessionStorage incorrectly
146
-
147
- ## Testing Commands
148
-
149
- Open browser console and run:
150
-
151
- ```javascript
152
- // Check current session ID
153
- console.log('Session ID:', sessionStorage.getItem('guideai_session_id'));
154
-
155
- // Check metadata tracker
156
- console.log('Metadata:', window.GuideAI?.metadata?.getMetadata());
157
-
158
- // Manually trigger login (to test metadata updates)
159
- window.GuideAI?.metadata?.trackLogin({ userId: 'test-123', email: 'test@example.com' });
160
-
161
- // Manually trigger custom event
162
- window.GuideAI?.metadata?.trackCustomEvent('test_event', { key: 'value' });
163
-
164
- // Check pending updates
165
- window.GuideAI?.metadata?.syncMetadata();
166
- ```
167
-
168
- ## Backend Validation
169
-
170
- Your backend should now:
171
- - ✅ Accept requests with sessionId in correct locations
172
- - ✅ Return 200 for valid requests
173
- - ✅ Return 400 if sessionId is missing (with helpful error message)
174
- - ✅ Log warnings if email/userId are missing (but still accept)
175
-
176
- ## Success Criteria
177
-
178
- ### All Must Pass:
179
- 1. ✅ No 400 errors from /metadata-updates
180
- 2. ✅ No 400 errors from /events
181
- 3. ✅ sessionId appears in all API calls
182
- 4. ✅ sessionId is consistent within same browser tab
183
- 5. ✅ sessionId format is valid UUID
184
- 6. ✅ Backend accepts and processes all requests
185
-
186
- ## Next Steps After Testing
187
-
188
- Once testing confirms everything works:
189
-
190
- 1. **Commit the changes:**
191
- ```bash
192
- git add guide-ai-package/src/metric/metadata-tracker.tsx
193
- git commit -m "feat: Add sessionId to metadata-updates API calls
194
-
195
- - Include sessionId in all MetadataUpdate.data objects
196
- - Complies with backend validation requirements
197
- - Fixes 400 errors from missing sessionId field"
198
- ```
199
-
200
- 2. **Push to your branch:**
201
- ```bash
202
- git push origin improvement/api-integration
203
- ```
204
-
205
- 3. **Create PR** with test results
206
-
207
- ## Questions or Issues?
208
-
209
- If you encounter any problems during testing:
210
- - Check the browser console for errors
211
- - Check the Network tab for full request/response
212
- - Verify sessionStorage has `guideai_session_id`
213
- - Ensure you rebuilt and reloaded the package
214
-
215
-
package/GuideAI.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- export interface GuideAIProps {
3
- apiKey?: string;
4
- organizationKey: string;
5
- position?: {
6
- top?: string;
7
- right?: string;
8
- bottom?: string;
9
- left?: string;
10
- marginTop?: string;
11
- marginRight?: string;
12
- marginBottom?: string;
13
- marginLeft?: string;
14
- transform?: string;
15
- };
16
- onError?: (error: string | Error, context?: string) => void;
17
- }
18
- declare const GuideAI: (props: GuideAIProps) => React.JSX.Element | null;
19
- export default GuideAI;