@truly-you/trulyyou-web-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +9 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +9 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/sdk/TrulyYouSDK.d.ts +77 -0
- package/dist/types.d.ts +36 -0
- package/package.json +43 -0
- package/rollup.config.js +58 -0
- package/src/index.ts +3 -0
- package/src/sdk/TrulyYouSDK.ts +1805 -0
- package/src/types.ts +40 -0
- package/tsconfig.json +20 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface TrulyYouSDKConfig {
|
|
2
|
+
frontendUrl?: string
|
|
3
|
+
apiUrl?: string
|
|
4
|
+
appId?: string
|
|
5
|
+
authAppId?: string
|
|
6
|
+
invisible?: boolean // Optional: render signing iframe invisibly (except on iOS/Safari)
|
|
7
|
+
targetElement?: string | HTMLElement // Optional: Target element for SDK placement when not invisible
|
|
8
|
+
spinnerColor?: string // Optional: Custom color for the loading spinner (default: #2563eb)
|
|
9
|
+
spinnerBgColor?: string // Optional: Custom background color for the spinner ring (default: #e5e7eb)
|
|
10
|
+
spinnerTextColor?: string // Optional: Custom color for the spinner text (default: #6b7280)
|
|
11
|
+
realtimeUrl?: string // Optional: WebSocket URL for desktop handoff (default: inferred from frontendUrl)
|
|
12
|
+
mockMobileDevice?: boolean // Optional: Simulate mobile device (force on-device signing, ignore platform detection)
|
|
13
|
+
pusherAppKey?: string // Optional: Pusher app key (default: 'app-key' if not provided)
|
|
14
|
+
pusherConfig?: {
|
|
15
|
+
wsHost?: string
|
|
16
|
+
wsPort?: number
|
|
17
|
+
cluster?: string // Optional: Pusher cluster (required if using custom wsHost/wsPort, use empty string to disable default)
|
|
18
|
+
forceTLS?: boolean
|
|
19
|
+
encrypted?: boolean
|
|
20
|
+
disableStats?: boolean
|
|
21
|
+
enabledTransports?: string[]
|
|
22
|
+
} // Optional: Custom Pusher configuration
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface FetchOptions extends RequestInit {
|
|
26
|
+
headers?: Record<string, string>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SigningResult {
|
|
30
|
+
signature: string
|
|
31
|
+
keyId: string
|
|
32
|
+
signatureId?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FetchResult {
|
|
36
|
+
response: Response
|
|
37
|
+
signature?: string
|
|
38
|
+
signatureId?: string
|
|
39
|
+
}
|
|
40
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2020", "DOM"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"allowSyntheticDefaultImports": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|
|
20
|
+
|