@transmitsecurity/platform-web-sdk 1.15.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 (74) hide show
  1. package/CHANGELOG.md +479 -0
  2. package/README.md +72 -0
  3. package/VITE_CONFIG.md +107 -0
  4. package/build/drs-entry.d.ts +20 -0
  5. package/build/drs-entry.js +19 -0
  6. package/build/drs-only.d.ts +22 -0
  7. package/build/drs-only.js +25 -0
  8. package/build/drs.d.ts +13 -0
  9. package/build/drs.js +45 -0
  10. package/build/ido-entry.d.ts +17 -0
  11. package/build/ido-entry.js +19 -0
  12. package/build/ido.d.ts +8 -0
  13. package/build/ido.js +27 -0
  14. package/build/idv-entry.d.ts +17 -0
  15. package/build/idv-entry.js +19 -0
  16. package/build/idv.d.ts +8 -0
  17. package/build/idv.js +27 -0
  18. package/build/initialize-only.d.ts +7 -0
  19. package/build/initialize-only.js +40 -0
  20. package/build/initialize.d.ts +1 -0
  21. package/build/initialize.js +2 -0
  22. package/build/mainExport.d.ts +16 -0
  23. package/build/mainExport.js +43 -0
  24. package/build/sdk-factory.d.ts +109 -0
  25. package/build/sdk-factory.js +108 -0
  26. package/build/shared-state.d.ts +4 -0
  27. package/build/shared-state.js +32 -0
  28. package/build/webauthn-entry.d.ts +19 -0
  29. package/build/webauthn-entry.js +19 -0
  30. package/build/webauthn.d.ts +12 -0
  31. package/build/webauthn.js +44 -0
  32. package/bundler-config.json +15 -0
  33. package/dist/docs/.nojekyll +1 -0
  34. package/dist/docs/README.md +72 -0
  35. package/dist/docs/enums/ErrorCode.md +113 -0
  36. package/dist/docs/interfaces/ActionEventOptions.md +44 -0
  37. package/dist/docs/interfaces/ActionResponse.md +9 -0
  38. package/dist/docs/interfaces/AuthenticationAutofillActivateHandlers.md +61 -0
  39. package/dist/docs/interfaces/AutofillHandlers.md +50 -0
  40. package/dist/docs/interfaces/CrossDeviceController.md +27 -0
  41. package/dist/docs/interfaces/SdkError.md +28 -0
  42. package/dist/docs/interfaces/WebauthnApis.md +73 -0
  43. package/dist/docs/interfaces/WebauthnAuthenticationFlows.md +52 -0
  44. package/dist/docs/interfaces/WebauthnCrossDeviceFlows.md +107 -0
  45. package/dist/docs/interfaces/WebauthnCrossDeviceRegistrationOptions.md +23 -0
  46. package/dist/docs/interfaces/WebauthnRegistrationOptions.md +55 -0
  47. package/dist/docs/interfaces/initConfigParams.md +7 -0
  48. package/dist/docs/modules/drs.md +92 -0
  49. package/dist/docs/modules/idv.md +106 -0
  50. package/dist/docs/modules/webauthn.md +197 -0
  51. package/dist/docs/modules.md +146 -0
  52. package/dist/drs.cjs +1 -0
  53. package/dist/drs.d.ts +241 -0
  54. package/dist/drs.js +1 -0
  55. package/dist/ido.cjs +1 -0
  56. package/dist/ido.d.ts +8 -0
  57. package/dist/ido.js +1 -0
  58. package/dist/idv.cjs +1 -0
  59. package/dist/idv.d.ts +68 -0
  60. package/dist/idv.js +1 -0
  61. package/dist/index.cjs +1 -0
  62. package/dist/index.esm.js +1 -0
  63. package/dist/index.umd.js +1 -0
  64. package/dist/ts-platform-websdk.js +1 -0
  65. package/dist/web-sdk-drs+idv+webauthn+ido.js +1 -0
  66. package/dist/web-sdk.d.ts +1737 -0
  67. package/dist/webauthn.cjs +1 -0
  68. package/dist/webauthn.d.ts +461 -0
  69. package/dist/webauthn.js +1 -0
  70. package/package.json +98 -0
  71. package/scripts/make-semver-aliases.sh +11 -0
  72. package/scripts/upload-dist.sh +6 -0
  73. package/src/mainExport.ts +75 -0
  74. package/src/tsconfig.json +14 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,479 @@
1
+ # Changelog
2
+ ## 1.14.0 - Jun. 15, 2025
3
+ **Orchestration**
4
+ * feat: Optimize device validation flow
5
+ * feat: Optimize risk recommendation flow
6
+ * feat: Add Select Organization step type
7
+
8
+ **Fraud Prevention**
9
+ * feat: Add support for passing custom attributes to the `triggerActionEvent`
10
+
11
+
12
+ ## 1.13.7 - Jun. 8, 2025
13
+ **Identity Verification**
14
+ * Correct and update UI texts
15
+ *
16
+
17
+ ## 1.13.6 - May 25, 2025
18
+ * fix: prevent race condition during crypto binding keys generation
19
+
20
+ **Fraud Prevention**
21
+ * feat: Added support for buffer interval flush after X seconds
22
+ * fix: Fix keys for buffer flush after certain interval or events threshold
23
+
24
+ ## 1.13.5 - May 18, 2025
25
+ **Webauthn**
26
+ * Add the possibility to have ':' char in the approval data schema.
27
+
28
+ ## 1.13.4 - May 13, 2025
29
+ **Orchestration**
30
+ * fix: Fixed content type header of the key_exchange requests
31
+ * fix: prevent race condition during crypto binding keys generation
32
+ * fix: Fix encryption headers lost after IDV redirect causing unencrypted API calls (FLOP-2912)
33
+
34
+ ## 1.13.2 - May 4, 2025
35
+ **Fraud Prevention**
36
+ * fix: improve getSessionToken flow to ensure it is not called while the SDK is not initialized
37
+
38
+ ## 1.13.1 - Apr. 27, 2025
39
+ **Identity Verification**
40
+ * fix: Hide loading block when API request completes
41
+
42
+ ## 1.13.0 - Apr. 20, 2025
43
+ **Fraud Prevention**
44
+ * Add enhanced and descriptive error codes to the `triggerActionEvent` method to improve granularity and explainability of errors
45
+ * Improve SDK resilience during initialization, ensuring proper handling of configuration refresh failures
46
+
47
+ **Identity Verification**
48
+ * fix: improve session recapture logic
49
+
50
+ ## 1.12.2 - Apr. 6, 2025
51
+ **Fraud Prevention**
52
+ * feat: Add support for reporting claimedUserIdType in triggerActionEvent method
53
+
54
+ **Webauthn**
55
+ * fix: Handle limitSingleCredentialToDevice validation error
56
+
57
+ ## 1.12.1 - Mar. 30, 2025
58
+ **Orchestration**
59
+ * fix: Improved PKCS7 unpadding validation and error handling during double encryption
60
+ * fix: Include `clientId` query param in `/key_exchange` calls to allow cloudflare worker to route to the correct tenant application
61
+ * feat: Introduce `StartSsoJourneyOptions`, currently with only `encrypted:? boolean`. The implementation defaults to `false` if unspecified.
62
+
63
+ ## 1.12.0 - Mar. 23, 2025
64
+ **Orchestration**
65
+ * feat: Support transport `Double Encryption`, for IDO SDK initially
66
+
67
+ ## 1.11.2 - Mar. 23, 2025
68
+ **Identity Verification**
69
+ * fix: show custom feedback if error is of type restriction criteria
70
+
71
+ ## 1.11.1 - Mar. 9, 2025
72
+ **Fraud Prevention**
73
+ * feat: Add session token refresh in case session token is expired
74
+
75
+ ## 1.11.0 - Mar. 2, 2025
76
+ **Fraud Prevention**
77
+ * fix: Avoid print an empty error on CDPR check
78
+
79
+ **Webauthn**
80
+ * fix: Support Mosaic URL wildcard (Internal use)
81
+
82
+ **Orchestration**
83
+ * feat: Add support for `Web to Mobile Authentication` and `Web to Mobile Transaction Signing` actions
84
+
85
+ **Identity Verification**
86
+ * feat: Add support for auto-capture capabilities
87
+
88
+ ## 1.10.6 - Feb. 10, 2025
89
+ **Fraud Prevention**
90
+ * feat: Send sessionToken backend-maintain signal in every event
91
+
92
+ ## 1.10.5 - Feb. 9, 2025
93
+ **Fraud Prevention**
94
+ * feat: Store Session Token in browser
95
+ * feat: Immediate sessionToken retrieval in case of identification event
96
+ * feat: Receive and store backend reported userId on any event sent
97
+ * feat: On any clearUser call - send clear user event
98
+
99
+ ## 1.10.4 - Feb. 2, 2025
100
+ **Identity Verification**
101
+ * fix: Stop pulling status after moving from capturing steps.
102
+
103
+ ## 1.10.3 - Jan. 19, 2025
104
+ **Orchestration**
105
+ * feat: Add support for `Transaction Signing` with passkeys action.
106
+
107
+ ## 1.10.2 - Jan. 12, 2025
108
+ **Webauthn**
109
+ * feat: Allow anonymous transaction signing, (without username parameter).
110
+
111
+ * **Identity Verification**
112
+ * feat: Add error handling for expired session status
113
+
114
+ ## 1.10.1 - Dec. 22, 2024
115
+ **Fraud Prevention**
116
+ * feat: Increase session token resilience within the session
117
+
118
+ **Orchestration**
119
+ * refactor: change request logging to debug level
120
+
121
+ ## 1.10.0 - Nov. 17, 2024
122
+ **Identity Verification**
123
+ * feat: Sign images with crypto-binding
124
+
125
+ **Fraud Prevention**
126
+ * feat: Persist userId if reported with successful authentication through action result interface
127
+
128
+ ## 1.9.12 - Oct. 20, 2024
129
+ **Identity Verification**
130
+ * feat: Improve texts on capturing pages
131
+
132
+ ## 1.9.11 - Oct. 13, 2024
133
+ **Webauthn**
134
+ * fix: Authentication timeout configuration issue
135
+
136
+ ## 1.9.10 - Sep. 22, 2024
137
+ **Fraud Prevention**
138
+ * fix: Improve event consistency in network failures and re-send also in mid-sessions
139
+
140
+ **Identity Verification**
141
+ * fix: fix Portuguese lang initial
142
+ * feat: add support to french-canadian
143
+
144
+ **Orchestration**
145
+ * feat: added support for Transaction Signing with TOTP action.
146
+ * fix: made the save SDK data operation synchronous to ensure it won't be interrupted.
147
+
148
+ ## 1.9.9 - Sep. 15, 2024
149
+ **Fraud Prevention**
150
+ * feat: setAuthenticatedUser enhancement
151
+ * feat: Event consistency improvement
152
+
153
+ ## 1.9.8 - Sep. 1, 2024
154
+ **Orchestration**
155
+ * feat: Support saving data in IndexedDB for Ido SDK
156
+
157
+ **Identity Verification**
158
+ * feat: Add new resubmit reason "Restricted document"
159
+
160
+ ## 1.9.7 - Aug. 25, 2024
161
+ **Identity Verification**
162
+ * fix: Fixing marked import issue
163
+
164
+ ## 1.9.6 – Aug. 07, 2024
165
+ * feat: Automatic migration of clientId dependent crypto binding keys to clientId independent, in sdk upgrade
166
+
167
+ **Fraud Prevention**
168
+ * feat: Support identifiers migration under first-party domains
169
+
170
+ ## 1.9.5 – Jul. 21, 2024
171
+ * feat: Add version field
172
+
173
+ **Fraud Prevention**
174
+ * fix: Reduce final DRS bundle size by 30%
175
+
176
+ ## 1.9.4 – Jul. 07, 2024
177
+ **Orchestration**
178
+ * fix: fix escape failure presentation type
179
+ * fix: remove default applicationId from the SDK interface
180
+ * feat: sdk pass escapes to the application
181
+ * feat: introduce invokeSsoJourney()
182
+ * feat: add validate email and phone actions
183
+
184
+ **Fraud Prevention**
185
+ * fix: Remove challenge data object from triggerAction response
186
+
187
+ ## 1.9.3 – Jun. 16, 2024
188
+ **Identity Verification**
189
+ * feat: Support dynamic document acquisition failure by restriction criteria custom message
190
+ * feat: Error messages improvements
191
+
192
+ ## 1.9.2 – Jun. 2, 2024
193
+ **Identity Verification**
194
+ * feat: add support for custom video capture settings
195
+
196
+ **Orchestration**
197
+ * feat: handle optional resource param
198
+
199
+ ## 1.9.1 – May. 26, 2024
200
+ **Identity Verification**
201
+ * feat: add message for customer support guidance
202
+
203
+ ## 1.9.0 – May. 19, 2024
204
+ **Fraud Prevention**
205
+ * feat: Support new datapoints related to audio fingerprint and device data
206
+ * feat: Support payer.bankIdentifier new field in transactionData optional action property
207
+
208
+ ## 1.8.1 – May. 12, 2024
209
+ **Identity Verification**
210
+ * feat: add error message to error callback
211
+
212
+ ## 1.8.0 – May. 6, 2024
213
+ **Orchestration**
214
+ * feat: handle expired OTP passcode
215
+ * feat: support invoke external idp action (oidc)
216
+ * feat: support the new variant of the login-form action
217
+
218
+ **Fraud Prevention**
219
+ * feat: Enforced encrypted communication
220
+
221
+ ## 1.7.3 – May. 1, 2024
222
+ **Fraud Prevention**
223
+ * fix: Remove datapoint for efficiency improvement
224
+
225
+ ## 1.7.2 – Apr. 30, 2024
226
+ **Fraud Prevention**
227
+ * fix: Update collected datapoints when page is loaded
228
+
229
+ ## 1.7.1 – Apr. 21, 2024
230
+ **Fraud Prevention**
231
+ * feat: Support new datapoints when page is loaded and device data
232
+
233
+ ## 1.7.0 – Apr. 14, 2024
234
+ **Webauthn**
235
+ * feat: added support for approval signing
236
+ * feat: saving clientId in memory with fallback to localStorage
237
+ * feat: Add the ability to limit single credential to device
238
+ * feat: Support set timeout for webauthn registration and authentication modals
239
+
240
+ **Fraud Prevention**
241
+ * feat: Support sending device data also in every action (per customer need)
242
+ * feat: Add new datapoints to SDK: navigatorOnLine, navigatorIsUserActive, navigatorVirtualKeyboard, windowHistoryLength
243
+
244
+ ## 1.6.30 – Apr. 7, 2024
245
+ **Fraud Prevention**
246
+ * fix: Enhance sessionToken consistency
247
+
248
+ **Identity Verification**
249
+ * feat: support trigger drs session token api
250
+
251
+ **Orchestration**
252
+ * fix: correctly handle server's assertion errors in sdk
253
+ * feat: add support for otp retry and resend
254
+ * feat: support auto replay in register / validate device actions
255
+
256
+ ## 1.6.29 – Mar. 31, 2024
257
+ **Identity Verification**
258
+ * feat: support new refinement failure reasons
259
+
260
+ **Orchestration**
261
+ * feat: provide correct client response for OTP authentication actions.
262
+
263
+
264
+ ## 1.6.28 – Mar. 24, 2024
265
+ **Orchestration**
266
+ * feat: added support for TOTP Registration
267
+
268
+ **Identity Verification**
269
+ * feat: use state manager as single source to decide next step in flow
270
+
271
+ ## 1.6.27 – Mar. 17, 2024
272
+ **Identity Verification**
273
+ * feat: send api error code on error callback
274
+
275
+ ## 1.6.26 – Feb. 25, 2024
276
+ **Orchestration**
277
+ * feat: allow cross site cookies
278
+ **Identity Verification**
279
+ * feat: use containing element as reference to calculate width to support landscape in tablets
280
+
281
+ ## 1.6.25 – Feb. 18, 2024
282
+ **Identity Verification**
283
+ * feat: accept CSS variables defined by implementor to set font and font weight
284
+
285
+ ## 1.6.24 – Feb. 11, 2024
286
+ * feat: Global crypto-binding keys are clientId independent for consistency
287
+
288
+ **Fraud Prevention**
289
+ * feat: Use crypto-binding clientId independent
290
+
291
+ **Webauthn**
292
+ * fix: unhandled errors on unsupported browsers
293
+
294
+ **Orchestration**
295
+ * feat: Use crypto-binding clientId independent
296
+
297
+ ## 1.6.23 – Jan. 18, 2024
298
+ **Orchestration**
299
+ * fix: Serialized state to handle with unicode characters
300
+
301
+ ## 1.6.22 – Jan. 14, 2024
302
+ **Identity Verification**
303
+ * fix: log `DRS` acquire action token error
304
+
305
+ ## 1.6.21 – Jan. 7, 2024
306
+ **Fraud Prevention**
307
+ * feat: expose `getSessionToken` public function interface
308
+
309
+ ## 1.6.20 – Dec. 31, 2023
310
+ **Orchestration**
311
+ * feat: changed `clientResponseOptions` to be an object instead of a map
312
+ * feat: added `failure_data` to `IdoServiceResponse`
313
+
314
+ ## 1.6.19 – Dec. 27, 2023
315
+ **Webauthn**
316
+ * feat: added support for the Australian domain `api.au.transmitsecurity.io`
317
+
318
+ ## 1.6.18 – Dec. 26, 2023
319
+ * feat: added support for Edge 18
320
+
321
+ ## 1.6.17 – Dec. 24, 2023
322
+ **Fraud Prevention**
323
+ * feat: improved performance in user mouse events attributes collection
324
+
325
+ ## 1.6.16 – Dec. 20, 2023
326
+ **WebAuthn**
327
+ * feat: added `onReady` handler to activate autofill
328
+ * fix: caught autofill abort signal error
329
+
330
+ ## 1.6.15 – Dec. 13, 2023
331
+ **Orchestration**
332
+ * fix: changed WebAuthn registration action internal name
333
+
334
+ ## 1.6.14 – Dec. 10, 2023
335
+ **Fraud Prevention**
336
+ * fix: `AuditFingerprint` edge case in Safari iOS
337
+
338
+ ## 1.6.13 – Dec. 6, 2023
339
+ **Orchestration**
340
+ * feat: added New Authentication action
341
+ * fix: `WaitForAnotherDevice` action
342
+
343
+ ## 1.6.12 – Dec. 5, 2023
344
+ **Identity Verification**
345
+ * fix: missing `init` param bug
346
+
347
+ ## 1.6.11 – Dec. 3, 2023
348
+ **Identity Verification**
349
+ * feat: removed default API endpoint URL
350
+
351
+ ## 1.6.10 - Nov. 29, 2023
352
+ **Orchestration**
353
+ * feat: added the new `generateDebugPin` action
354
+ * feat: simplified the journey response fields, `type` is now deprecated
355
+
356
+ ## 1.6.9 - Nov. 15, 2023
357
+ **Fraud Prevention**
358
+ * feat: added support for collecting `mouseup` & `mousedown` interaction events, added pressing indication for mouse events
359
+
360
+ ## 1.6.8 - Nov. 13, 2023
361
+ **Orchestration**
362
+ * fix: `Validate device` action
363
+
364
+ ## 1.6.7 - Nov. 6, 2023
365
+ **Orchestration**
366
+ * fix: `Register`/ `Validate device` actions
367
+
368
+ ## 1.6.6 - Nov. 5, 2023
369
+ **Fraud Prevention**
370
+ * fix: sending new `navigator.userAgentData` in every event for retrieving the latest OS & browser versions in Chromium-based browsers
371
+ **Orchestration**
372
+ * fix: version
373
+
374
+ ## 1.6.5 - Nov. 2, 2023
375
+ **Orchestration**
376
+ * feat: supported `Register`/ `Validate device` actions
377
+ * feat: added journey completion token to `IdoServiceResponse`
378
+
379
+ ## 1.6.4 - Oct. 23, 2023
380
+ **Orchestration**
381
+ * feat: supported `WebAuthn registration` action
382
+
383
+ ## 1.6.3 - Oct. 17, 2023
384
+ **Orchestration**
385
+ * feat: supported `DRS trigger` action
386
+ * feat: supported `IDV hosted` action
387
+
388
+ ## 1.6.2 - Oct. 16, 2023
389
+ **Identity Verification**
390
+ * fix: added validation on camera video stream start before submitting an image
391
+
392
+ ## 1.6.1 - Oct. 15, 2023
393
+ **Fraud Prevention**
394
+ * feat: added tracking crypto-binding identifiers on every action
395
+
396
+ ## 1.6.0 - Oct. 5, 2023
397
+ **WebAuthn**
398
+ * feat: added support for cross-device flow
399
+
400
+ ## 1.5.15 - Oct. 2, 2023
401
+ **Identity Verification**
402
+ * feat: allowed BI event API to be used with generated interfaces
403
+
404
+ ## 1.5.14 - Sep. 20, 2023
405
+ **Identity Verification**
406
+ * fix: selfie placeholder frame missing on iOS 17
407
+
408
+ ## 1.5.13 - Sep. 13, 2023
409
+ **Fraud Prevention**
410
+ * improvements and fixes
411
+
412
+ ## 1.5.12 - Sep. 13, 2023
413
+ **Fraud Prevention**
414
+ * feat: added new data points for better detection abilities
415
+
416
+ **Orchestration**
417
+ * feat: supported `crypto binding validation` action
418
+
419
+ ## 1.5.11 - Sep. 5, 2023
420
+ **Identity Verification**
421
+ * feat: added multiple stream validation for camera
422
+
423
+ ## 1.5.10 - Sep. 1, 2023
424
+ **Identity Verification**
425
+ * fix: error thrown when initializing the SDK without IDV params
426
+
427
+ **Orchestration**
428
+ * feat: added support for `Wait for CSM` action
429
+
430
+ ## 1.5.9 - Aug. 28, 2023
431
+ **Identity Verification**
432
+ * fix: issues starting video source
433
+
434
+ ## 1.5.8 - Aug. 22, 2023
435
+ **Identity Verification**
436
+ * fix: camera feed starts in zoom
437
+
438
+ ## 1.5.7 - Aug. 21, 2023
439
+ **Identity Verification**
440
+ * fix: SDK hosted app unexpected back behavior
441
+
442
+ ## 1.5.6 - Aug. 15, 2023
443
+ **WebAuthn**
444
+ * feat: exposed GET default WebAuthn API paths function
445
+
446
+ ## 1.5.0 - Jul. 23, 2023
447
+ **WebAuthn**
448
+
449
+ * BREAKING CHANGE: SDK init on event instead of invocation init
450
+
451
+ ## 1.4.0 - Jul. 12, 2023
452
+ **WebAuthn**
453
+
454
+ * BREAKING CHANGE: introduced WebAuthn backend registration
455
+ * BREAKING CHANGE: introduced backend authentication SDK
456
+ * feat: added `autofill` handler
457
+ * feat: implemented new SDK errors and removed SDK rejection
458
+ * feat: moved WebAuthn support indication functions to a new version of SDK
459
+ * feat: introduced a new structure for WebAuthn SDK
460
+ * fix: activate `autofill` again after aborting
461
+ * fix: added `start registration` endpoint
462
+ * fix: converted type to interfaces
463
+ * fix: interfaces and documentation
464
+ * fix: removed async from `autofill` actions
465
+ * fix: removed redundant allowed keys from local storage
466
+ * fix: removed unused dependencies and upgraded vulnerable packages
467
+ * fix: set device user in registration and changed interface
468
+ * fix: upgraded dependencies
469
+ * fix: wrong RP error handler
470
+
471
+ ## 1.3.0 - Jul. 5, 2023
472
+ * feat: added `ido` module
473
+
474
+ ## 1.1.1 - Jun. 19, 2023
475
+ * feat: added `idv` module
476
+
477
+ ## 1.0.0 - May 18, 2023
478
+ * feat: added `drs` module
479
+ * feat: added `webauthn` module
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # Transmit Security Platform Web SDK
2
+
3
+ A comprehensive browser-based identity and security solution with fraud prevention, WebAuthn authentication, identity verification, and orchestration capabilities.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @transmitsecurity/platform-web-sdk
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ### Recommended Usage (Full SDK Import)
14
+
15
+ ```js
16
+ import { drs, webauthn, idv, ido, initialize } from '@transmitsecurity/platform-web-sdk';
17
+
18
+ // Single initialize call for all modules
19
+ await initialize({
20
+ clientId: 'your-client-id',
21
+ drs: { serverPath: 'https://api.transmitsecurity.io/risk-collect/' },
22
+ webauthn: { serverPath: 'https://api.transmitsecurity.io' }
23
+ });
24
+
25
+ // Use the modules
26
+ await drs.triggerActionEvent('login', { correlationId: 'example' });
27
+ const isSupported = await webauthn.isPlatformAuthenticatorSupported();
28
+ ```
29
+
30
+ ### Individual Module Imports (Limited Support)
31
+
32
+ ⚠️ **Note**: Individual module imports have dependency resolution issues in some bundlers (like Vite). Use full SDK import for better compatibility.
33
+
34
+ ```js
35
+ // May cause dependency resolution errors in some environments
36
+ import { drs, initialize } from '@transmitsecurity/platform-web-sdk/drs';
37
+ import { webauthn } from '@transmitsecurity/platform-web-sdk/webauthn';
38
+
39
+ // Single initialize call
40
+ await initialize({
41
+ clientId: 'your-client-id',
42
+ drs: { serverPath: 'https://api.transmitsecurity.io/risk-collect/' },
43
+ webauthn: { serverPath: 'https://api.transmitsecurity.io' }
44
+ });
45
+ ```
46
+
47
+ ## Bundle Size
48
+
49
+ The SDK is optimized for production use:
50
+ - **Gzipped**: ~180KB
51
+ - **Uncompressed**: ~565KB
52
+ - **Tree-shaking**: Modern bundlers eliminate unused code automatically
53
+
54
+ ## Troubleshooting
55
+
56
+ ### Vite Dependency Resolution Errors
57
+
58
+ If you encounter errors like "Could not resolve @transmit-security/web-sdk-common", see [VITE_CONFIG.md](./VITE_CONFIG.md) for detailed solutions.
59
+
60
+ **Quick fix**: Use the full SDK import instead of individual module imports.
61
+
62
+ ### Other Bundlers
63
+
64
+ For webpack, Rollup, or other bundlers, the full SDK import should work without additional configuration.
65
+
66
+ ## Documentation
67
+
68
+ For complete documentation, visit: https://github.com/transmitsecurity-dev/ciam-web-sdk
69
+
70
+ ## License
71
+
72
+ SEE LICENSE IN LICENSE
package/VITE_CONFIG.md ADDED
@@ -0,0 +1,107 @@
1
+ # Vite Configuration for Platform Web SDK
2
+
3
+ If you encounter dependency resolution errors when using this SDK with Vite, follow these solutions:
4
+
5
+ ## Solution 1: Exclude from Dependency Optimization (Required)
6
+
7
+ Add this to your `vite.config.js`:
8
+
9
+ ```js
10
+ import { defineConfig } from 'vite'
11
+
12
+ export default defineConfig({
13
+ optimizeDeps: {
14
+ exclude: [
15
+ '@transmitsecurity/platform-web-sdk',
16
+ '@transmitsecurity/platform-web-sdk/drs',
17
+ '@transmitsecurity/platform-web-sdk/webauthn',
18
+ '@transmitsecurity/platform-web-sdk/idv',
19
+ '@transmitsecurity/platform-web-sdk/ido'
20
+ ]
21
+ },
22
+ build: {
23
+ rollupOptions: {
24
+ external: [
25
+ '@transmit-security/web-sdk-common',
26
+ '@transmit-security/riskid_sdk',
27
+ '@transmit-security/authentication-sdk',
28
+ '@transmit-security/ts-identity-verification',
29
+ '@transmit-security/ido-web-sdk'
30
+ ]
31
+ }
32
+ }
33
+ })
34
+ ```
35
+
36
+ ## Solution 2: Use Full SDK Import (Recommended)
37
+
38
+ **❌ Avoid individual module imports for now:**
39
+ ```js
40
+ // This causes dependency resolution errors
41
+ import { drs, initialize } from '@transmitsecurity/platform-web-sdk/drs';
42
+ ```
43
+
44
+ **✅ Use full SDK import instead:**
45
+ ```js
46
+ // This works reliably
47
+ import { drs, webauthn, initialize } from '@transmitsecurity/platform-web-sdk';
48
+
49
+ await initialize({
50
+ clientId: 'your-client-id',
51
+ drs: { serverPath: 'https://api.transmitsecurity.io/risk-collect/' },
52
+ webauthn: { serverPath: 'https://api.transmitsecurity.io' }
53
+ });
54
+ ```
55
+
56
+ ## Solution 3: Alternative Vite Configuration
57
+
58
+ If you still want to try individual imports, add this more comprehensive configuration:
59
+
60
+ ```js
61
+ import { defineConfig } from 'vite'
62
+
63
+ export default defineConfig({
64
+ optimizeDeps: {
65
+ exclude: [
66
+ '@transmitsecurity/platform-web-sdk',
67
+ '@transmitsecurity/platform-web-sdk/drs',
68
+ '@transmitsecurity/platform-web-sdk/webauthn',
69
+ '@transmitsecurity/platform-web-sdk/idv',
70
+ '@transmitsecurity/platform-web-sdk/ido'
71
+ ],
72
+ include: []
73
+ },
74
+ define: {
75
+ global: 'globalThis',
76
+ },
77
+ resolve: {
78
+ alias: {
79
+ // Fallback for missing dependencies
80
+ '@transmit-security/web-sdk-common': '@transmitsecurity/platform-web-sdk',
81
+ '@transmit-security/riskid_sdk': '@transmitsecurity/platform-web-sdk',
82
+ }
83
+ }
84
+ })
85
+ ```
86
+
87
+ ## Solution 4: Clear Vite Cache
88
+
89
+ Always clear the Vite cache when switching configurations:
90
+
91
+ ```bash
92
+ rm -rf node_modules/.vite
93
+ npm run dev
94
+ ```
95
+
96
+ ## Current Limitation
97
+
98
+ **Individual module imports are currently not fully supported** due to dependency bundling architecture.
99
+
100
+ **Recommended approach**: Use the full SDK import until the build system is updated to create truly self-contained modules.
101
+
102
+ ## Bundle Size Impact
103
+
104
+ Even with full SDK import, the bundle is optimized:
105
+ - **Gzipped size**: ~180KB
106
+ - **Uncompressed**: ~565KB
107
+ - **Tree-shaking**: Unused functions are still eliminated by modern bundlers
@@ -0,0 +1,20 @@
1
+ export interface DRSModule {
2
+ triggerActionEvent: (action: string, options: any) => Promise<any>;
3
+ setUser: (userId: string) => void;
4
+ clearUser: () => void;
5
+ }
6
+ export interface SDKConfig {
7
+ clientId: string;
8
+ serverPath?: string;
9
+ drs?: {
10
+ serverPath?: string;
11
+ verbose?: boolean;
12
+ enableSessionToken?: boolean;
13
+ };
14
+ }
15
+ /**
16
+ * 🎯 **DRS (Device Risk & Security)** (~219KB bundle)
17
+ * Perfect for fraud detection and risk assessment
18
+ */
19
+ export declare function createDRS(config: SDKConfig): Promise<any>;
20
+ export { createDRS as drs };
@@ -0,0 +1,19 @@
1
+ // 🎯 DRS-Only Entry Point for Perfect Tree-Shaking
2
+ import { initialize } from './initialize-only';
3
+ import * as drsModule from './drs';
4
+ /**
5
+ * 🎯 **DRS (Device Risk & Security)** (~219KB bundle)
6
+ * Perfect for fraud detection and risk assessment
7
+ */
8
+ export async function createDRS(config) {
9
+ // ✅ Validation
10
+ if (!config.clientId) {
11
+ throw new Error('❌ clientId is required');
12
+ }
13
+ // 🔧 Initialize core
14
+ await initialize(config);
15
+ // 🔄 Return DRS module
16
+ return drsModule;
17
+ }
18
+ // Export for WebSDK class compatibility
19
+ export { createDRS as drs };