@transmitsecurity/platform-web-sdk 1.16.2 → 1.17.1

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 (77) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/README.md +69 -48
  3. package/dist/web-sdk-drs+idv+webauthn+ido.js +2 -2
  4. package/dist/web-sdk.d.ts +4 -16
  5. package/package.json +12 -13
  6. package/build/drs-entry.d.ts +0 -20
  7. package/build/drs-entry.js +0 -19
  8. package/build/drs-only.d.ts +0 -22
  9. package/build/drs-only.js +0 -25
  10. package/build/drs.d.ts +0 -28
  11. package/build/drs.js +0 -45
  12. package/build/ido/idoImpl.d.ts +0 -2
  13. package/build/ido/idoImpl.js +0 -4
  14. package/build/ido/index.d.ts +0 -7
  15. package/build/ido/index.js +0 -9
  16. package/build/ido-entry.d.ts +0 -17
  17. package/build/ido-entry.js +0 -19
  18. package/build/ido.d.ts +0 -18
  19. package/build/ido.js +0 -27
  20. package/build/idv-entry.d.ts +0 -17
  21. package/build/idv-entry.js +0 -19
  22. package/build/idv.d.ts +0 -18
  23. package/build/idv.js +0 -27
  24. package/build/initialize-only.d.ts +0 -7
  25. package/build/initialize-only.js +0 -40
  26. package/build/initialize.d.ts +0 -1
  27. package/build/initialize.js +0 -2
  28. package/build/mainExport.d.ts +0 -16
  29. package/build/mainExport.js +0 -43
  30. package/build/sdk-factory.d.ts +0 -109
  31. package/build/sdk-factory.js +0 -108
  32. package/build/shared-state.d.ts +0 -4
  33. package/build/shared-state.js +0 -32
  34. package/build/webauthn-entry.d.ts +0 -19
  35. package/build/webauthn-entry.js +0 -19
  36. package/build/webauthn.d.ts +0 -24
  37. package/build/webauthn.js +0 -44
  38. package/bundler-config.json +0 -14
  39. package/dist/docs/.nojekyll +0 -1
  40. package/dist/docs/README.md +0 -72
  41. package/dist/docs/enums/ErrorCode.md +0 -113
  42. package/dist/docs/interfaces/ActionEventOptions.md +0 -44
  43. package/dist/docs/interfaces/ActionResponse.md +0 -9
  44. package/dist/docs/interfaces/AuthenticationAutofillActivateHandlers.md +0 -61
  45. package/dist/docs/interfaces/AutofillHandlers.md +0 -50
  46. package/dist/docs/interfaces/CrossDeviceController.md +0 -27
  47. package/dist/docs/interfaces/SdkError.md +0 -28
  48. package/dist/docs/interfaces/WebauthnApis.md +0 -73
  49. package/dist/docs/interfaces/WebauthnAuthenticationFlows.md +0 -52
  50. package/dist/docs/interfaces/WebauthnCrossDeviceFlows.md +0 -107
  51. package/dist/docs/interfaces/WebauthnCrossDeviceRegistrationOptions.md +0 -23
  52. package/dist/docs/interfaces/WebauthnRegistrationOptions.md +0 -55
  53. package/dist/docs/interfaces/initConfigParams.md +0 -7
  54. package/dist/docs/modules/drs.md +0 -92
  55. package/dist/docs/modules/idv.md +0 -106
  56. package/dist/docs/modules/webauthn.md +0 -197
  57. package/dist/docs/modules.md +0 -146
  58. package/dist/drs.cjs +0 -1
  59. package/dist/drs.d.ts +0 -248
  60. package/dist/drs.js +0 -1
  61. package/dist/ido.cjs +0 -3
  62. package/dist/ido.d.ts +0 -57
  63. package/dist/ido.js +0 -3
  64. package/dist/idv.cjs +0 -1
  65. package/dist/idv.d.ts +0 -69
  66. package/dist/idv.js +0 -1
  67. package/dist/index.cjs +0 -3
  68. package/dist/index.esm.js +0 -3
  69. package/dist/index.umd.js +0 -3
  70. package/dist/ts-platform-websdk.js +0 -3
  71. package/dist/webauthn.cjs +0 -1
  72. package/dist/webauthn.d.ts +0 -463
  73. package/dist/webauthn.js +0 -1
  74. package/scripts/make-semver-aliases.sh +0 -11
  75. package/scripts/upload-dist.sh +0 -9
  76. package/src/mainExport.ts +0 -75
  77. package/src/tsconfig.json +0 -14
package/dist/web-sdk.d.ts CHANGED
@@ -112,7 +112,7 @@ interface ActionEventOptions {
112
112
  declare class TSAccountProtection {
113
113
  private static initializedInstance;
114
114
  private initializationPromise;
115
- private isSDKDisabled;
115
+ private disabledReason;
116
116
  private enableSessionToken;
117
117
  private identifiersMigrationEnabled;
118
118
  private firstPartyMigrationUrl;
@@ -137,6 +137,7 @@ declare class TSAccountProtection {
137
137
  constructor(clientId: string, options?: ConstructorOptions);
138
138
  /** @ignore */
139
139
  constructor(serverPath: string, clientId: string);
140
+ private generateDisabledToken;
140
141
  /**
141
142
  * @ignore
142
143
  * @returns List of loaded actions that can be invoked
@@ -1753,19 +1754,6 @@ interface initConfigParams {
1753
1754
 
1754
1755
  declare function initialize(params: initConfigParams): void;
1755
1756
 
1756
- /**
1757
- * Main SDK class for CDN usage (window.tsPlatform)
1758
- * Provides access to all modules and common functionality
1759
- */
1760
- declare class TSWebSDK {
1761
- factories: {
1762
- drs: () => Record<string, any>;
1763
- idv: () => Record<string, any>;
1764
- };
1765
- constructor();
1766
- }
1767
- declare const _default: TSWebSDK;
1768
-
1769
- declare const PACKAGE_VERSION = "1.16.2";
1757
+ declare const PACKAGE_VERSION = "1.17.1";
1770
1758
 
1771
- export { ActionEventOptions, ActionResponse, AuthenticationAutofillActivateHandlers, AutofillHandlers, CrossDeviceController, ErrorCode$1 as ErrorCode, PACKAGE_VERSION, SdkError, WebauthnApis, WebauthnAuthenticationFlows, WebauthnCrossDeviceFlows, WebauthnCrossDeviceRegistrationOptions, WebauthnRegistrationOptions, authenticate, crossDevice, _default as default, webSdkModule_d as drs, getDefaultPaths, instance as ido, index_d$1 as idv, initConfigParams, initialize, isAutofillSupported, isPlatformAuthenticatorSupported, register, index_d as webauthn };
1759
+ export { ActionEventOptions, ActionResponse, AuthenticationAutofillActivateHandlers, AutofillHandlers, CrossDeviceController, ErrorCode$1 as ErrorCode, PACKAGE_VERSION, SdkError, WebauthnApis, WebauthnAuthenticationFlows, WebauthnCrossDeviceFlows, WebauthnCrossDeviceRegistrationOptions, WebauthnRegistrationOptions, authenticate, crossDevice, webSdkModule_d as drs, getDefaultPaths, instance as ido, index_d$1 as idv, initConfigParams, initialize, isAutofillSupported, isPlatformAuthenticatorSupported, register, index_d as webauthn };
package/package.json CHANGED
@@ -1,22 +1,20 @@
1
1
  {
2
2
  "name": "@transmitsecurity/platform-web-sdk",
3
- "version": "1.16.2",
3
+ "version": "1.17.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "private": false,
6
+ "type": "module",
6
7
  "main": "dist/index.cjs",
7
8
  "module": "dist/index.esm.js",
8
9
  "browser": "dist/ts-platform-websdk.js",
9
10
  "types": "dist/web-sdk.d.ts",
10
11
  "sideEffects": false,
11
12
  "files": [
12
- "dist/**/*",
13
- "build/**/*",
14
- "src/**/*",
13
+ "dist/*.js",
14
+ "dist/*.cjs",
15
+ "dist/*.d.ts",
15
16
  "CHANGELOG.md",
16
- "bundler-config.json",
17
- "scripts/**/*",
18
- "README.md",
19
- "VITE_CONFIG.md"
17
+ "README.md"
20
18
  ],
21
19
  "repository": {
22
20
  "type": "git",
@@ -73,15 +71,16 @@
73
71
  "distribute:env": "./scripts/upload-dist.sh",
74
72
  "publish:npm": "npm publish --access public"
75
73
  },
74
+ "dependencies": {},
76
75
  "devDependencies": {
77
76
  "@rollup/plugin-json": "6.1.0",
78
- "@transmit-security/web-sdk-bundler": "0.1.14",
79
- "@types/node": "20.3.3",
80
77
  "@transmit-security/authentication-sdk": "4.12.0",
81
78
  "@transmit-security/ido-web-sdk": "0.0.73",
82
- "@transmit-security/riskid_sdk": "1.52.0",
83
- "@transmit-security/ts-identity-verification": "1.4.8",
84
- "@transmit-security/web-sdk-common": "1.2.0",
79
+ "@transmit-security/riskid_sdk": "1.52.6",
80
+ "@transmit-security/ts-identity-verification": "1.4.10",
81
+ "@transmit-security/web-sdk-bundler": "0.1.14",
82
+ "@transmit-security/web-sdk-common": "1.2.1",
83
+ "@types/node": "20.3.3",
85
84
  "vite": "^5.0.0"
86
85
  },
87
86
  "engines": {
@@ -1,20 +0,0 @@
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 };
@@ -1,19 +0,0 @@
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 };
@@ -1,22 +0,0 @@
1
- import * as drsModule from './drs';
2
- export interface SDKConfig {
3
- clientId: string;
4
- serverPath?: string;
5
- drs?: {
6
- serverPath?: string;
7
- verbose?: boolean;
8
- enableSessionToken?: boolean;
9
- };
10
- }
11
- /**
12
- * šŸš€ **WebSDK** - DRS Only
13
- * Perfect tree-shaking with only DRS module (~219KB)
14
- */
15
- export declare class WebSDK {
16
- /**
17
- * šŸŽÆ **DRS (Device Risk & Security)** (~219KB bundle)
18
- * Perfect for fraud detection and risk assessment
19
- */
20
- static drs(config: SDKConfig): Promise<typeof drsModule>;
21
- }
22
- export declare const PACKAGE_VERSION = "1.15.0";
package/build/drs-only.js DELETED
@@ -1,25 +0,0 @@
1
- // šŸŽÆ DRS-Only Entry Point for Perfect Tree-Shaking
2
- import { initialize } from './initialize-only';
3
- import * as drsModule from './drs';
4
- /**
5
- * šŸš€ **WebSDK** - DRS Only
6
- * Perfect tree-shaking with only DRS module (~219KB)
7
- */
8
- export class WebSDK {
9
- /**
10
- * šŸŽÆ **DRS (Device Risk & Security)** (~219KB bundle)
11
- * Perfect for fraud detection and risk assessment
12
- */
13
- static async drs(config) {
14
- // āœ… Validation
15
- if (!config.clientId) {
16
- throw new Error('āŒ clientId is required');
17
- }
18
- // šŸ”§ Initialize core
19
- await initialize(config);
20
- // šŸ”„ Return DRS module
21
- return drsModule;
22
- }
23
- }
24
- // Export version for compatibility
25
- export const PACKAGE_VERSION = '1.15.0';
package/build/drs.d.ts DELETED
@@ -1,28 +0,0 @@
1
- declare global {
2
- interface Window {
3
- __TS_WEB_SDK_INITIALIZED__?: boolean;
4
- __TS_WEB_SDK_CONFIG__?: any;
5
- }
6
- }
7
- export { initialize } from './initialize-only';
8
- export * from '@transmit-security/riskid_sdk';
9
- export declare const triggerActionEvent: (...args: any[]) => any;
10
- export declare const setUser: (...args: any[]) => any;
11
- export declare const setAuthenticatedUser: (...args: any[]) => any;
12
- export declare const clearUser: (...args: any[]) => any;
13
- export type { ActionEventOptions, ActionResponse } from "@transmit-security/riskid_sdk";
14
-
15
- // Default export for better TypeScript support
16
- declare const drs: {
17
- initialize: typeof initialize;
18
- triggerActionEvent: (...args: any[]) => any;
19
- setUser: (...args: any[]) => any;
20
- setAuthenticatedUser: (...args: any[]) => any;
21
- clearUser: (...args: any[]) => any;
22
- getSessionToken: (...args: any[]) => any;
23
- getActions: (...args: any[]) => any;
24
- identifyUser: (...args: any[]) => any;
25
- unidentifiedUser: (...args: any[]) => any;
26
- };
27
-
28
- export default drs;
package/build/drs.js DELETED
@@ -1,45 +0,0 @@
1
- // DRS module - clean entry point with global state awareness
2
- import { setInitConfig, getInitConfig } from '@transmit-security/web-sdk-common/dist/module-metadata/module-metadata';
3
- import { emit } from '@transmit-security/web-sdk-common/dist/events';
4
- import { MODULE_INITIALIZED } from '@transmit-security/web-sdk-common/dist/events';
5
- // Function to sync global initialization state when needed
6
- function ensureInitialized() {
7
- if (typeof window !== 'undefined' && window.__TS_WEB_SDK_INITIALIZED__ && window.__TS_WEB_SDK_CONFIG__) {
8
- try {
9
- const currentConfig = getInitConfig();
10
- if (!currentConfig || !currentConfig.clientId) {
11
- console.log('šŸ”„ Syncing global initialization state to DRS module');
12
- setInitConfig(window.__TS_WEB_SDK_CONFIG__);
13
- emit(MODULE_INITIALIZED, undefined);
14
- return true;
15
- }
16
- return true;
17
- }
18
- catch (error) {
19
- // If getInitConfig fails, it means common module is not initialized
20
- console.log('šŸ”„ Initializing DRS module with global state');
21
- setInitConfig(window.__TS_WEB_SDK_CONFIG__);
22
- emit(MODULE_INITIALIZED, undefined);
23
- return true;
24
- }
25
- }
26
- return false;
27
- }
28
- // Import the original RiskID SDK
29
- import * as originalDRS from '@transmit-security/riskid_sdk';
30
- // Create wrapper functions for the main DRS methods
31
- function wrapDRSMethod(methodName, originalMethod) {
32
- return function (...args) {
33
- ensureInitialized();
34
- return originalMethod.apply(originalDRS, args);
35
- };
36
- }
37
- // Re-export initialize to ensure shared state
38
- export { initialize } from './initialize-only';
39
- // Export all DRS functionality (re-export everything)
40
- export * from '@transmit-security/riskid_sdk';
41
- // Override the main methods with wrapped versions
42
- export const triggerActionEvent = wrapDRSMethod('triggerActionEvent', originalDRS.triggerActionEvent);
43
- export const setUser = wrapDRSMethod('setUser', originalDRS.setUser);
44
- export const setAuthenticatedUser = wrapDRSMethod('setAuthenticatedUser', originalDRS.setAuthenticatedUser);
45
- export const clearUser = wrapDRSMethod('clearUser', originalDRS.clearUser);
@@ -1,2 +0,0 @@
1
- export * from '@transmit-security/ido-web-sdk';
2
- export { default as initializeIDO } from '@transmit-security/ido-web-sdk';
@@ -1,4 +0,0 @@
1
- // Re-export everything from the actual IDO web SDK
2
- export * from '@transmit-security/ido-web-sdk';
3
- // Export specific functions that might be needed
4
- export { default as initializeIDO } from '@transmit-security/ido-web-sdk';
@@ -1,7 +0,0 @@
1
- export { initializeIDO as initialize } from './idoImpl';
2
- export * from './idoImpl';
3
- export declare const startJourney: (journeyId: string, options?: import("@transmit-security/ido-web-sdk/dist/sdk_interface").StartJourneyOptions | undefined) => Promise<import("@transmit-security/ido-web-sdk/dist/sdk_interface").IdoServiceResponse>;
4
- export declare const startSsoJourney: (interactionId: string, options?: import("@transmit-security/ido-web-sdk/dist/sdk_interface").StartSsoJourneyOptions | undefined) => Promise<import("@transmit-security/ido-web-sdk/dist/sdk_interface").IdoServiceResponse>;
5
- export declare const submitClientResponse: (clientResponseOptionId: string, data?: any) => Promise<import("@transmit-security/ido-web-sdk/dist/sdk_interface").IdoServiceResponse>;
6
- export declare const serializeState: () => string;
7
- export declare const restoreFromSerializedState: (state: string) => import("@transmit-security/ido-web-sdk/dist/sdk_interface").IdoServiceResponse;
@@ -1,9 +0,0 @@
1
- export { initializeIDO as initialize } from './idoImpl';
2
- export * from './idoImpl';
3
- // Import the default export and re-export its functions as named exports
4
- import idoWebSdk from '@transmit-security/ido-web-sdk';
5
- export const startJourney = idoWebSdk.startJourney;
6
- export const startSsoJourney = idoWebSdk.startSsoJourney;
7
- export const submitClientResponse = idoWebSdk.submitClientResponse;
8
- export const serializeState = idoWebSdk.serializeState;
9
- export const restoreFromSerializedState = idoWebSdk.restoreFromSerializedState;
@@ -1,17 +0,0 @@
1
- export interface IDOModule {
2
- executeFlow: (flowId: string, options?: any) => Promise<any>;
3
- getFlowStatus: (executionId: string) => Promise<any>;
4
- }
5
- export interface SDKConfig {
6
- clientId: string;
7
- serverPath?: string;
8
- ido?: {
9
- serverPath?: string;
10
- };
11
- }
12
- /**
13
- * šŸ”„ **IDO (Identity Orchestration)** (~2KB bundle)
14
- * Perfect for orchestration workflows
15
- */
16
- export declare function createIDO(config: SDKConfig): Promise<any>;
17
- export { createIDO as ido };
@@ -1,19 +0,0 @@
1
- // šŸ”„ IDO-Only Entry Point for Perfect Tree-Shaking
2
- import { initialize } from './initialize-only';
3
- import * as idoModule from './ido';
4
- /**
5
- * šŸ”„ **IDO (Identity Orchestration)** (~2KB bundle)
6
- * Perfect for orchestration workflows
7
- */
8
- export async function createIDO(config) {
9
- // āœ… Validation
10
- if (!config.clientId) {
11
- throw new Error('āŒ clientId is required');
12
- }
13
- // šŸ”§ Initialize core
14
- await initialize(config);
15
- // šŸ”„ Return IDO module
16
- return idoModule;
17
- }
18
- // Export for WebSDK class compatibility
19
- export { createIDO as ido };
package/build/ido.d.ts DELETED
@@ -1,18 +0,0 @@
1
- declare global {
2
- interface Window {
3
- __TS_WEB_SDK_INITIALIZED__?: boolean;
4
- __TS_WEB_SDK_CONFIG__?: any;
5
- }
6
- }
7
- export { initialize } from './initialize-only';
8
- export * from '@transmit-security/ido-web-sdk';
9
-
10
- // Default export for better TypeScript support
11
- declare const ido: {
12
- initialize: typeof initialize;
13
- startJourney: (...args: any[]) => any;
14
- completeStep: (...args: any[]) => any;
15
- getJourneyState: (...args: any[]) => any;
16
- };
17
-
18
- export default ido;
package/build/ido.js DELETED
@@ -1,27 +0,0 @@
1
- // IDO module - clean entry point with global state awareness
2
- import { setInitConfig, getInitConfig } from '@transmit-security/web-sdk-common/dist/module-metadata/module-metadata';
3
- import { emit } from '@transmit-security/web-sdk-common/dist/events';
4
- import { MODULE_INITIALIZED } from '@transmit-security/web-sdk-common/dist/events';
5
- // Check for global initialization state and sync with common module on import
6
- (function syncGlobalInitialization() {
7
- if (typeof window !== 'undefined' && window.__TS_WEB_SDK_INITIALIZED__ && window.__TS_WEB_SDK_CONFIG__) {
8
- try {
9
- const currentConfig = getInitConfig();
10
- if (!currentConfig || !currentConfig.clientId) {
11
- console.log('šŸ”„ Syncing global initialization state to IDO module');
12
- setInitConfig(window.__TS_WEB_SDK_CONFIG__);
13
- emit(MODULE_INITIALIZED, undefined);
14
- }
15
- }
16
- catch (error) {
17
- // If getInitConfig fails, it means common module is not initialized
18
- console.log('šŸ”„ Initializing IDO module with global state');
19
- setInitConfig(window.__TS_WEB_SDK_CONFIG__);
20
- emit(MODULE_INITIALIZED, undefined);
21
- }
22
- }
23
- })();
24
- // Re-export initialize to ensure shared state
25
- export { initialize } from './initialize-only';
26
- // Export all IDO functionality
27
- export * from '@transmit-security/ido-web-sdk';
@@ -1,17 +0,0 @@
1
- export interface IDVModule {
2
- startVerification: (options: any) => Promise<any>;
3
- getVerificationStatus: (sessionId: string) => Promise<any>;
4
- }
5
- export interface SDKConfig {
6
- clientId: string;
7
- serverPath?: string;
8
- idv?: {
9
- serverPath?: string;
10
- };
11
- }
12
- /**
13
- * šŸ†” **IDV (Identity Verification)** (~589KB bundle)
14
- * Perfect for identity verification flows
15
- */
16
- export declare function createIDV(config: SDKConfig): Promise<any>;
17
- export { createIDV as idv };
@@ -1,19 +0,0 @@
1
- // šŸ†” IDV-Only Entry Point for Perfect Tree-Shaking
2
- import { initialize } from './initialize-only';
3
- import * as idvModule from './idv';
4
- /**
5
- * šŸ†” **IDV (Identity Verification)** (~589KB bundle)
6
- * Perfect for identity verification flows
7
- */
8
- export async function createIDV(config) {
9
- // āœ… Validation
10
- if (!config.clientId) {
11
- throw new Error('āŒ clientId is required');
12
- }
13
- // šŸ”§ Initialize core
14
- await initialize(config);
15
- // šŸ”„ Return IDV module
16
- return idvModule;
17
- }
18
- // Export for WebSDK class compatibility
19
- export { createIDV as idv };
package/build/idv.d.ts DELETED
@@ -1,18 +0,0 @@
1
- declare global {
2
- interface Window {
3
- __TS_WEB_SDK_INITIALIZED__?: boolean;
4
- __TS_WEB_SDK_CONFIG__?: any;
5
- }
6
- }
7
- export { initialize } from './initialize-only';
8
- export * from '@transmit-security/ts-identity-verification';
9
-
10
- // Default export for better TypeScript support
11
- declare const idv: {
12
- initialize: typeof initialize;
13
- startDocumentCapture: (...args: any[]) => any;
14
- startFaceCapture: (...args: any[]) => any;
15
- startSelfieCapture: (...args: any[]) => any;
16
- };
17
-
18
- export default idv;
package/build/idv.js DELETED
@@ -1,27 +0,0 @@
1
- // IDV module - clean entry point with global state awareness
2
- import { setInitConfig, getInitConfig } from '@transmit-security/web-sdk-common/dist/module-metadata/module-metadata';
3
- import { emit } from '@transmit-security/web-sdk-common/dist/events';
4
- import { MODULE_INITIALIZED } from '@transmit-security/web-sdk-common/dist/events';
5
- // Check for global initialization state and sync with common module on import
6
- (function syncGlobalInitialization() {
7
- if (typeof window !== 'undefined' && window.__TS_WEB_SDK_INITIALIZED__ && window.__TS_WEB_SDK_CONFIG__) {
8
- try {
9
- const currentConfig = getInitConfig();
10
- if (!currentConfig || !currentConfig.clientId) {
11
- console.log('šŸ”„ Syncing global initialization state to IDV module');
12
- setInitConfig(window.__TS_WEB_SDK_CONFIG__);
13
- emit(MODULE_INITIALIZED, undefined);
14
- }
15
- }
16
- catch (error) {
17
- // If getInitConfig fails, it means common module is not initialized
18
- console.log('šŸ”„ Initializing IDV module with global state');
19
- setInitConfig(window.__TS_WEB_SDK_CONFIG__);
20
- emit(MODULE_INITIALIZED, undefined);
21
- }
22
- }
23
- })();
24
- // Re-export initialize to ensure shared state
25
- export { initialize } from './initialize-only';
26
- // Export all IDV functionality
27
- export * from '@transmit-security/ts-identity-verification';
@@ -1,7 +0,0 @@
1
- declare global {
2
- interface Window {
3
- __TS_WEB_SDK_INITIALIZED__?: boolean;
4
- __TS_WEB_SDK_CONFIG__?: any;
5
- }
6
- }
7
- export declare function initialize(config: any): Promise<void>;
@@ -1,40 +0,0 @@
1
- // Minimal initialize module - only initialization logic
2
- import { setInitConfig } from '@transmit-security/web-sdk-common/dist/module-metadata/module-metadata';
3
- import { emit } from '@transmit-security/web-sdk-common/dist/events';
4
- import { MODULE_INITIALIZED } from '@transmit-security/web-sdk-common/dist/events';
5
- // Browser Environment Validation (run once globally)
6
- (function validateBrowserEnvironment() {
7
- var _a, _b;
8
- const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
9
- const isNode = typeof globalThis !== 'undefined' &&
10
- typeof globalThis.process !== 'undefined' &&
11
- ((_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.versions) === null || _b === void 0 ? void 0 : _b.node);
12
- if (isNode && !isBrowser) {
13
- throw new Error('\n🚫 @TransmitSecurity/web-sdk is a BROWSER-ONLY package.\n\n' +
14
- 'āŒ Node.js environments are not supported.\n' +
15
- 'āœ… Use this package in web browsers only.\n\n' +
16
- 'For more information, visit: https://github.com/transmitsecurity-dev/ciam-web-sdk#browser-only\n');
17
- }
18
- if (!isBrowser) {
19
- console.warn('āš ļø @TransmitSecurity/web-sdk: Browser environment not detected. ' +
20
- 'Some features may not work correctly.');
21
- }
22
- })();
23
- export async function initialize(config) {
24
- try {
25
- // Store config in both the common module and global window
26
- setInitConfig(config);
27
- // Store initialization state globally so DRS can access it
28
- if (typeof window !== 'undefined') {
29
- window.__TS_WEB_SDK_INITIALIZED__ = true;
30
- window.__TS_WEB_SDK_CONFIG__ = config;
31
- }
32
- // Emit initialization event
33
- emit(MODULE_INITIALIZED, undefined);
34
- console.log('āœ… SDK initialized successfully');
35
- }
36
- catch (error) {
37
- console.error('āŒ SDK initialization failed:', error);
38
- throw error;
39
- }
40
- }
@@ -1 +0,0 @@
1
- export { initialize } from './initialize-only';
@@ -1,2 +0,0 @@
1
- // Initialize module - clean entry point
2
- export { initialize } from './initialize-only';
@@ -1,16 +0,0 @@
1
- export * from '@transmit-security/web-sdk-common/dist/main-entry';
2
- export type { ActionEventOptions, ActionResponse } from "@transmit-security/riskid_sdk";
3
- export type { authenticate, WebauthnApis, WebauthnAuthenticationFlows, AutofillHandlers, AuthenticationAutofillActivateHandlers, WebauthnRegistrationOptions, isAutofillSupported, SdkError, ErrorCode, isPlatformAuthenticatorSupported, register, crossDevice, CrossDeviceController, WebauthnCrossDeviceRegistrationOptions, WebauthnCrossDeviceFlows, getDefaultPaths } from '@transmit-security/authentication-sdk';
4
- /**
5
- * Main SDK class for CDN usage (window.tsPlatform)
6
- * Provides access to all modules and common functionality
7
- */
8
- declare class TSWebSDK {
9
- factories: {
10
- drs: () => Record<string, any>;
11
- idv: () => Record<string, any>;
12
- };
13
- constructor();
14
- }
15
- declare const _default: TSWebSDK;
16
- export default _default;
@@ -1,43 +0,0 @@
1
- // Browser Environment Validation
2
- (function validateBrowserEnvironment() {
3
- var _a, _b;
4
- const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
5
- const isNode = typeof globalThis !== 'undefined' &&
6
- typeof globalThis.process !== 'undefined' &&
7
- ((_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.versions) === null || _b === void 0 ? void 0 : _b.node);
8
- if (isNode && !isBrowser) {
9
- throw new Error('\n🚫 @TransmitSecurity/web-sdk is a BROWSER-ONLY package.\n\n' +
10
- 'āŒ Node.js environments are not supported.\n' +
11
- 'āœ… Use this package in web browsers only.\n\n' +
12
- 'For more information, visit: https://github.com/transmitsecurity-dev/ciam-web-sdk#browser-only\n');
13
- }
14
- if (!isBrowser) {
15
- console.warn('āš ļø @TransmitSecurity/web-sdk: Browser environment not detected. ' +
16
- 'Some features may not work correctly.');
17
- }
18
- })();
19
- // Export common SDK functionality (initialize, etc.)
20
- export * from '@transmit-security/web-sdk-common/dist/main-entry';
21
- // Import individual modules
22
- import * as drsMod from '@transmit-security/riskid_sdk';
23
- import * as idvMod from '@transmit-security/ts-identity-verification';
24
- // Module factories for dynamic loading
25
- const factories = {
26
- drs: drsMod,
27
- idv: idvMod,
28
- };
29
- /**
30
- * Main SDK class for CDN usage (window.tsPlatform)
31
- * Provides access to all modules and common functionality
32
- */
33
- class TSWebSDK {
34
- constructor() {
35
- this.factories = factories;
36
- // Attach DRS module functions
37
- Object.assign(this, drsMod);
38
- // Attach IDV module functions
39
- Object.assign(this, idvMod);
40
- }
41
- }
42
- // Export default instance for CDN usage
43
- export default new TSWebSDK();