@glideidentity/web-client-sdk 4.4.8-beta.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 (136) hide show
  1. package/README.md +938 -0
  2. package/dist/adapters/angular/client.service.d.ts +7 -0
  3. package/dist/adapters/angular/client.service.js +30 -0
  4. package/dist/adapters/angular/index.d.ts +3 -0
  5. package/dist/adapters/angular/index.js +18 -0
  6. package/dist/adapters/angular/phone-auth.service.d.ts +38 -0
  7. package/dist/adapters/angular/phone-auth.service.js +130 -0
  8. package/dist/adapters/react/index.d.ts +9 -0
  9. package/dist/adapters/react/index.js +28 -0
  10. package/dist/adapters/react/useClient.d.ts +26 -0
  11. package/dist/adapters/react/useClient.js +121 -0
  12. package/dist/adapters/react/usePhoneAuth.d.ts +23 -0
  13. package/dist/adapters/react/usePhoneAuth.js +95 -0
  14. package/dist/adapters/vanilla/client.d.ts +8 -0
  15. package/dist/adapters/vanilla/client.js +33 -0
  16. package/dist/adapters/vanilla/index.d.ts +3 -0
  17. package/dist/adapters/vanilla/index.js +18 -0
  18. package/dist/adapters/vanilla/phone-auth.d.ts +46 -0
  19. package/dist/adapters/vanilla/phone-auth.js +138 -0
  20. package/dist/adapters/vue/index.d.ts +10 -0
  21. package/dist/adapters/vue/index.js +36 -0
  22. package/dist/adapters/vue/useClient.d.ts +115 -0
  23. package/dist/adapters/vue/useClient.js +131 -0
  24. package/dist/adapters/vue/usePhoneAuth.d.ts +94 -0
  25. package/dist/adapters/vue/usePhoneAuth.js +103 -0
  26. package/dist/browser/web-client-sdk.min.js +2 -0
  27. package/dist/browser/web-client-sdk.min.js.LICENSE.txt +1 -0
  28. package/dist/browser.d.ts +7 -0
  29. package/dist/browser.js +31 -0
  30. package/dist/core/client.d.ts +22 -0
  31. package/dist/core/client.js +77 -0
  32. package/dist/core/logger.d.ts +130 -0
  33. package/dist/core/logger.js +370 -0
  34. package/dist/core/phone-auth/api-types.d.ts +525 -0
  35. package/dist/core/phone-auth/api-types.js +215 -0
  36. package/dist/core/phone-auth/client.d.ts +187 -0
  37. package/dist/core/phone-auth/client.js +1353 -0
  38. package/dist/core/phone-auth/error-utils.d.ts +110 -0
  39. package/dist/core/phone-auth/error-utils.js +350 -0
  40. package/dist/core/phone-auth/index.d.ts +7 -0
  41. package/dist/core/phone-auth/index.js +47 -0
  42. package/dist/core/phone-auth/status-types.d.ts +107 -0
  43. package/dist/core/phone-auth/status-types.js +31 -0
  44. package/dist/core/phone-auth/strategies/desktop.d.ts +113 -0
  45. package/dist/core/phone-auth/strategies/desktop.js +502 -0
  46. package/dist/core/phone-auth/strategies/index.d.ts +11 -0
  47. package/dist/core/phone-auth/strategies/index.js +15 -0
  48. package/dist/core/phone-auth/strategies/link.d.ts +81 -0
  49. package/dist/core/phone-auth/strategies/link.js +265 -0
  50. package/dist/core/phone-auth/strategies/ts43.d.ts +32 -0
  51. package/dist/core/phone-auth/strategies/ts43.js +146 -0
  52. package/dist/core/phone-auth/strategies/types.d.ts +18 -0
  53. package/dist/core/phone-auth/strategies/types.js +6 -0
  54. package/dist/core/phone-auth/type-guards.d.ts +125 -0
  55. package/dist/core/phone-auth/type-guards.js +160 -0
  56. package/dist/core/phone-auth/types.d.ts +232 -0
  57. package/dist/core/phone-auth/types.js +93 -0
  58. package/dist/core/phone-auth/ui/mobile-debug-console.d.ts +25 -0
  59. package/dist/core/phone-auth/ui/mobile-debug-console.js +288 -0
  60. package/dist/core/phone-auth/ui/modal.d.ts +84 -0
  61. package/dist/core/phone-auth/ui/modal.js +574 -0
  62. package/dist/core/phone-auth/validation-utils.d.ts +66 -0
  63. package/dist/core/phone-auth/validation-utils.js +182 -0
  64. package/dist/core/types.d.ts +62 -0
  65. package/dist/core/types.js +2 -0
  66. package/dist/core/version.d.ts +1 -0
  67. package/dist/core/version.js +5 -0
  68. package/dist/esm/adapters/angular/client.service.d.ts +7 -0
  69. package/dist/esm/adapters/angular/client.service.js +27 -0
  70. package/dist/esm/adapters/angular/index.d.ts +3 -0
  71. package/dist/esm/adapters/angular/index.js +4 -0
  72. package/dist/esm/adapters/angular/phone-auth.service.d.ts +38 -0
  73. package/dist/esm/adapters/angular/phone-auth.service.js +127 -0
  74. package/dist/esm/adapters/react/index.d.ts +9 -0
  75. package/dist/esm/adapters/react/index.js +8 -0
  76. package/dist/esm/adapters/react/useClient.d.ts +26 -0
  77. package/dist/esm/adapters/react/useClient.js +116 -0
  78. package/dist/esm/adapters/react/usePhoneAuth.d.ts +23 -0
  79. package/dist/esm/adapters/react/usePhoneAuth.js +92 -0
  80. package/dist/esm/adapters/vanilla/client.d.ts +8 -0
  81. package/dist/esm/adapters/vanilla/client.js +29 -0
  82. package/dist/esm/adapters/vanilla/index.d.ts +3 -0
  83. package/dist/esm/adapters/vanilla/index.js +4 -0
  84. package/dist/esm/adapters/vanilla/phone-auth.d.ts +46 -0
  85. package/dist/esm/adapters/vanilla/phone-auth.js +134 -0
  86. package/dist/esm/adapters/vue/index.d.ts +10 -0
  87. package/dist/esm/adapters/vue/index.js +11 -0
  88. package/dist/esm/adapters/vue/useClient.d.ts +115 -0
  89. package/dist/esm/adapters/vue/useClient.js +127 -0
  90. package/dist/esm/adapters/vue/usePhoneAuth.d.ts +94 -0
  91. package/dist/esm/adapters/vue/usePhoneAuth.js +100 -0
  92. package/dist/esm/browser.d.ts +7 -0
  93. package/dist/esm/browser.js +11 -0
  94. package/dist/esm/core/client.d.ts +22 -0
  95. package/dist/esm/core/client.js +70 -0
  96. package/dist/esm/core/logger.d.ts +130 -0
  97. package/dist/esm/core/logger.js +359 -0
  98. package/dist/esm/core/phone-auth/api-types.d.ts +525 -0
  99. package/dist/esm/core/phone-auth/api-types.js +203 -0
  100. package/dist/esm/core/phone-auth/client.d.ts +187 -0
  101. package/dist/esm/core/phone-auth/client.js +1316 -0
  102. package/dist/esm/core/phone-auth/error-utils.d.ts +110 -0
  103. package/dist/esm/core/phone-auth/error-utils.js +338 -0
  104. package/dist/esm/core/phone-auth/index.d.ts +7 -0
  105. package/dist/esm/core/phone-auth/index.js +6 -0
  106. package/dist/esm/core/phone-auth/status-types.d.ts +107 -0
  107. package/dist/esm/core/phone-auth/status-types.js +26 -0
  108. package/dist/esm/core/phone-auth/strategies/desktop.d.ts +113 -0
  109. package/dist/esm/core/phone-auth/strategies/desktop.js +496 -0
  110. package/dist/esm/core/phone-auth/strategies/index.d.ts +11 -0
  111. package/dist/esm/core/phone-auth/strategies/index.js +7 -0
  112. package/dist/esm/core/phone-auth/strategies/link.d.ts +81 -0
  113. package/dist/esm/core/phone-auth/strategies/link.js +261 -0
  114. package/dist/esm/core/phone-auth/strategies/ts43.d.ts +32 -0
  115. package/dist/esm/core/phone-auth/strategies/ts43.js +142 -0
  116. package/dist/esm/core/phone-auth/strategies/types.d.ts +18 -0
  117. package/dist/esm/core/phone-auth/strategies/types.js +5 -0
  118. package/dist/esm/core/phone-auth/type-guards.d.ts +125 -0
  119. package/dist/esm/core/phone-auth/type-guards.js +150 -0
  120. package/dist/esm/core/phone-auth/types.d.ts +232 -0
  121. package/dist/esm/core/phone-auth/types.js +76 -0
  122. package/dist/esm/core/phone-auth/ui/mobile-debug-console.d.ts +25 -0
  123. package/dist/esm/core/phone-auth/ui/mobile-debug-console.js +284 -0
  124. package/dist/esm/core/phone-auth/ui/modal.d.ts +84 -0
  125. package/dist/esm/core/phone-auth/ui/modal.js +570 -0
  126. package/dist/esm/core/phone-auth/validation-utils.d.ts +66 -0
  127. package/dist/esm/core/phone-auth/validation-utils.js +174 -0
  128. package/dist/esm/core/types.d.ts +62 -0
  129. package/dist/esm/core/types.js +1 -0
  130. package/dist/esm/core/version.d.ts +1 -0
  131. package/dist/esm/core/version.js +2 -0
  132. package/dist/esm/index.d.ts +12 -0
  133. package/dist/esm/index.js +15 -0
  134. package/dist/index.d.ts +12 -0
  135. package/dist/index.js +52 -0
  136. package/package.json +92 -0
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+ /**
3
+ * Glide Phone Authentication API Types
4
+ *
5
+ * This file is copied from the master API specification at /glide-api-types.ts
6
+ * It defines the exact contract that ALL implementations must follow.
7
+ *
8
+ * NAMING CONVENTION:
9
+ * - ALL TYPES USE snake_case FOR API COMMUNICATION
10
+ * - Frontend SDKs should use snake_case throughout for consistency
11
+ * - This eliminates conversion errors and makes debugging easier
12
+ * - While not idiomatic JavaScript, it matches the API exactly
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.E164_REGEX = exports.ERROR_STATUS_CODES = exports.ERROR_MESSAGES = exports.ERROR_CODE = exports.AUTHENTICATION_STRATEGY = exports.USE_CASE = void 0;
16
+ exports.validatePhoneNumber = validatePhoneNumber;
17
+ exports.validatePLMN = validatePLMN;
18
+ exports.validateSession = validateSession;
19
+ exports.validateUseCase = validateUseCase;
20
+ exports.createErrorResponse = createErrorResponse;
21
+ exports.getErrorStatusCode = getErrorStatusCode;
22
+ exports.isTS43Data = isTS43Data;
23
+ exports.isLinkData = isLinkData;
24
+ exports.isErrorResponse = isErrorResponse;
25
+ // ============================================================================
26
+ // USE CASES
27
+ // ============================================================================
28
+ exports.USE_CASE = {
29
+ GET_PHONE_NUMBER: 'GetPhoneNumber',
30
+ VERIFY_PHONE_NUMBER: 'VerifyPhoneNumber'
31
+ };
32
+ // ============================================================================
33
+ // AUTHENTICATION STRATEGIES
34
+ // ============================================================================
35
+ exports.AUTHENTICATION_STRATEGY = {
36
+ TS43: 'ts43',
37
+ LINK: 'link',
38
+ DESKTOP: 'desktop'
39
+ };
40
+ // ============================================================================
41
+ // ERROR HANDLING
42
+ // ============================================================================
43
+ /**
44
+ * Error codes - MUST match server implementation
45
+ */
46
+ exports.ERROR_CODE = {
47
+ // 400 Bad Request
48
+ INVALID_PHONE_NUMBER: 'INVALID_PHONE_NUMBER',
49
+ MISSING_REQUIRED_FIELD: 'MISSING_REQUIRED_FIELD',
50
+ INVALID_USE_CASE: 'INVALID_USE_CASE',
51
+ // 404 Not Found
52
+ INVALID_SESSION: 'INVALID_SESSION',
53
+ SESSION_EXPIRED: 'SESSION_EXPIRED',
54
+ // 422 Unprocessable Entity
55
+ CARRIER_NOT_ELIGIBLE: 'CARRIER_NOT_ELIGIBLE',
56
+ UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM',
57
+ PHONE_NUMBER_MISMATCH: 'PHONE_NUMBER_MISMATCH',
58
+ INVALID_CREDENTIAL: 'INVALID_CREDENTIAL',
59
+ VERIFICATION_FAILED: 'VERIFICATION_FAILED',
60
+ USE_CASE_MISMATCH: 'USE_CASE_MISMATCH',
61
+ // 429 Too Many Requests
62
+ RATE_LIMIT_EXCEEDED: 'RATE_LIMIT_EXCEEDED',
63
+ // 500 Internal Server Error
64
+ INTERNAL_SERVER_ERROR: 'INTERNAL_SERVER_ERROR',
65
+ // 503 Service Unavailable
66
+ SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE'
67
+ };
68
+ /**
69
+ * Error messages - User-friendly messages for each error code
70
+ */
71
+ exports.ERROR_MESSAGES = {
72
+ [exports.ERROR_CODE.INVALID_PHONE_NUMBER]: "Phone number must be in E.164 format",
73
+ [exports.ERROR_CODE.MISSING_REQUIRED_FIELD]: "Required field is missing",
74
+ [exports.ERROR_CODE.INVALID_USE_CASE]: "Use case must be 'GetPhoneNumber' or 'VerifyPhoneNumber'",
75
+ [exports.ERROR_CODE.INVALID_SESSION]: "Session not found or expired",
76
+ [exports.ERROR_CODE.SESSION_EXPIRED]: "Session has expired",
77
+ [exports.ERROR_CODE.CARRIER_NOT_ELIGIBLE]: "Your carrier does not support this verification method",
78
+ [exports.ERROR_CODE.UNSUPPORTED_PLATFORM]: "Your platform is not supported",
79
+ [exports.ERROR_CODE.PHONE_NUMBER_MISMATCH]: "Phone number does not match the device",
80
+ [exports.ERROR_CODE.INVALID_CREDENTIAL]: "Invalid or expired credential",
81
+ [exports.ERROR_CODE.VERIFICATION_FAILED]: "Phone number verification failed",
82
+ [exports.ERROR_CODE.USE_CASE_MISMATCH]: "Session was prepared for a different use case",
83
+ [exports.ERROR_CODE.RATE_LIMIT_EXCEEDED]: "Too many requests. Please try again later",
84
+ [exports.ERROR_CODE.INTERNAL_SERVER_ERROR]: "An unexpected error occurred",
85
+ [exports.ERROR_CODE.SERVICE_UNAVAILABLE]: "Service temporarily unavailable"
86
+ };
87
+ /**
88
+ * HTTP status codes for each error
89
+ */
90
+ exports.ERROR_STATUS_CODES = {
91
+ [exports.ERROR_CODE.INVALID_PHONE_NUMBER]: 400,
92
+ [exports.ERROR_CODE.MISSING_REQUIRED_FIELD]: 400,
93
+ [exports.ERROR_CODE.INVALID_USE_CASE]: 400,
94
+ [exports.ERROR_CODE.INVALID_SESSION]: 404,
95
+ [exports.ERROR_CODE.SESSION_EXPIRED]: 404,
96
+ [exports.ERROR_CODE.CARRIER_NOT_ELIGIBLE]: 422,
97
+ [exports.ERROR_CODE.UNSUPPORTED_PLATFORM]: 422,
98
+ [exports.ERROR_CODE.PHONE_NUMBER_MISMATCH]: 422,
99
+ [exports.ERROR_CODE.INVALID_CREDENTIAL]: 422,
100
+ [exports.ERROR_CODE.VERIFICATION_FAILED]: 422,
101
+ [exports.ERROR_CODE.USE_CASE_MISMATCH]: 422,
102
+ [exports.ERROR_CODE.RATE_LIMIT_EXCEEDED]: 429,
103
+ [exports.ERROR_CODE.INTERNAL_SERVER_ERROR]: 500,
104
+ [exports.ERROR_CODE.SERVICE_UNAVAILABLE]: 503
105
+ };
106
+ // ============================================================================
107
+ // VALIDATION HELPERS
108
+ // ============================================================================
109
+ /**
110
+ * E.164 phone number validation regex
111
+ */
112
+ exports.E164_REGEX = /^\+[1-9]\d{1,14}$/;
113
+ /**
114
+ * Validate phone number format
115
+ */
116
+ function validatePhoneNumber(phone) {
117
+ return exports.E164_REGEX.test(phone);
118
+ }
119
+ /**
120
+ * Validate PLMN format
121
+ */
122
+ function validatePLMN(plmn) {
123
+ // MCC: exactly 3 digits
124
+ if (!/^\d{3}$/.test(plmn.mcc))
125
+ return false;
126
+ // MNC: 2 or 3 digits
127
+ if (!/^\d{2,3}$/.test(plmn.mnc))
128
+ return false;
129
+ return true;
130
+ }
131
+ /**
132
+ * Validate session info
133
+ */
134
+ function validateSession(session) {
135
+ if (!session.session_key || session.session_key.length < 16)
136
+ return false;
137
+ // nonce and enc_key are optional and stored in metadata if needed
138
+ return true;
139
+ }
140
+ /**
141
+ * Validate use case
142
+ */
143
+ function validateUseCase(useCase) {
144
+ return useCase === exports.USE_CASE.GET_PHONE_NUMBER ||
145
+ useCase === exports.USE_CASE.VERIFY_PHONE_NUMBER;
146
+ }
147
+ /**
148
+ * Create error response helper
149
+ */
150
+ function createErrorResponse(code, details, requestId) {
151
+ return {
152
+ code,
153
+ message: exports.ERROR_MESSAGES[code],
154
+ request_id: requestId,
155
+ timestamp: new Date().toISOString(),
156
+ details
157
+ };
158
+ }
159
+ /**
160
+ * Get HTTP status code for error
161
+ */
162
+ function getErrorStatusCode(code) {
163
+ return exports.ERROR_STATUS_CODES[code] || 500;
164
+ }
165
+ // ============================================================================
166
+ // TYPE GUARDS
167
+ // ============================================================================
168
+ /**
169
+ * Check if data is TS43 strategy data
170
+ */
171
+ function isTS43Data(data) {
172
+ // Check for TS43 data structure - has protocol and data.dcql_query
173
+ return data &&
174
+ typeof data.protocol === 'string' &&
175
+ data.data &&
176
+ data.data.dcql_query;
177
+ }
178
+ /**
179
+ * Check if data is Link strategy data
180
+ */
181
+ function isLinkData(data) {
182
+ return data && data.url && typeof data.url === 'string';
183
+ }
184
+ /**
185
+ * Check if response is an error
186
+ */
187
+ function isErrorResponse(response) {
188
+ return response &&
189
+ typeof response.code === 'string' &&
190
+ typeof response.message === 'string';
191
+ }
192
+ // ============================================================================
193
+ // EXPORTS FOR CONVENIENCE
194
+ // ============================================================================
195
+ exports.default = {
196
+ // Constants
197
+ USE_CASE: exports.USE_CASE,
198
+ AUTHENTICATION_STRATEGY: exports.AUTHENTICATION_STRATEGY,
199
+ ERROR_CODE: exports.ERROR_CODE,
200
+ ERROR_MESSAGES: exports.ERROR_MESSAGES,
201
+ ERROR_STATUS_CODES: exports.ERROR_STATUS_CODES,
202
+ E164_REGEX: exports.E164_REGEX,
203
+ // Validators
204
+ validatePhoneNumber,
205
+ validatePLMN,
206
+ validateSession,
207
+ validateUseCase,
208
+ // Type guards
209
+ isTS43Data,
210
+ isLinkData,
211
+ isErrorResponse,
212
+ // Helpers
213
+ createErrorResponse,
214
+ getErrorStatusCode
215
+ };
@@ -0,0 +1,187 @@
1
+ import type { PrepareResponse, GetPhoneNumberResponse, VerifyPhoneNumberResponse, SecureCredentialResponse, SessionInfo, InvokeOptions, HeadlessResult } from './api-types';
2
+ import type { AuthConfig, PhoneAuthOptions, PhoneAuthResult } from './types';
3
+ import type { DesktopAuthOptions } from './strategies/desktop';
4
+ export declare class PhoneAuthClient {
5
+ private config;
6
+ private debug;
7
+ private logger;
8
+ private crossDeviceActive;
9
+ private retryCount;
10
+ private sessionCache;
11
+ private callbacks;
12
+ private baseTimeout;
13
+ private lastRequest?;
14
+ constructor(config?: AuthConfig);
15
+ /**
16
+ * Get user-friendly error message using error utilities
17
+ */
18
+ private getUserFriendlyMessage;
19
+ /**
20
+ * Log error with proper context and sanitization
21
+ */
22
+ private logError;
23
+ /**
24
+ * Check if the browser supports secure phone authentication
25
+ */
26
+ isSupported(): boolean;
27
+ /**
28
+ * Get detailed browser support information
29
+ */
30
+ getBrowserSupportInfo(): {
31
+ supported: boolean;
32
+ browser: string;
33
+ message?: string;
34
+ helpUrl?: string;
35
+ };
36
+ /**
37
+ * Main verification method with silent retry support
38
+ */
39
+ verify(options: PhoneAuthOptions): Promise<PhoneAuthResult>;
40
+ private verifyWithRetry;
41
+ /**
42
+ * High-level method to get phone number (complete flow)
43
+ * Handles prepare, credential prompt, and get phone number in one call
44
+ */
45
+ getPhoneNumberComplete(options?: Omit<PhoneAuthOptions, 'use_case' | 'phone_number'>): Promise<PhoneAuthResult>;
46
+ /**
47
+ * High-level method to verify phone number (complete flow)
48
+ * Handles prepare, credential prompt, and verification in one call
49
+ */
50
+ verifyPhoneNumberComplete(phoneNumber: string, options?: Omit<PhoneAuthOptions, 'use_case' | 'phone_number'>): Promise<PhoneAuthResult>;
51
+ /**
52
+ * Step 1: Prepare phone verification request
53
+ *
54
+ * This method prepares a secure request for phone verification.
55
+ * You can use this with your own backend or the glide-sdk-node.
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const request = await phoneAuthClient.preparePhoneRequest({ useCase: 'GetPhoneNumber' });
60
+ * // Handle the request with custom logic
61
+ * ```
62
+ */
63
+ preparePhoneRequest(options: PhoneAuthOptions): Promise<PrepareResponse>;
64
+ /**
65
+ * Step 2: Invoke secure prompt for user consent
66
+ *
67
+ * This method can work in two modes:
68
+ * 1. **UI Mode (default)**: Shows built-in UI components (modals/buttons)
69
+ * 2. **Headless Mode**: Returns raw data for custom UI implementation
70
+ *
71
+ * **Important**: This method automatically handles reactive objects from frameworks
72
+ * like Vue.js and React by deep cloning the input. This ensures compatibility with
73
+ * browser APIs that expect plain objects.
74
+ *
75
+ * @example UI Mode (shows modal/button)
76
+ * ```typescript
77
+ * // Shows SDK's built-in UI
78
+ * const credential = await phoneAuth.invokeSecurePrompt(prepareResult);
79
+ *
80
+ * // Customize the UI
81
+ * const credential = await phoneAuth.invokeSecurePrompt(prepareResult, {
82
+ * modalOptions: {
83
+ * title: 'Verify Your Identity',
84
+ * buttonText: 'Continue with Verizon'
85
+ * }
86
+ * });
87
+ * ```
88
+ *
89
+ * @example Headless Mode (returns data)
90
+ * ```typescript
91
+ * // Get raw data without showing UI
92
+ * const result = await phoneAuth.invokeSecurePrompt(prepareResult, {
93
+ * headless: true
94
+ * });
95
+ *
96
+ * if (result.strategy === 'link') {
97
+ * // Open URL yourself
98
+ * window.open(result.url);
99
+ * await result.pollingPromise; // Wait for completion
100
+ * }
101
+ * ```
102
+ *
103
+ * @param prepareResponse - Response from prepare() with strategy and data
104
+ * @param options - Control UI behavior or enable headless mode
105
+ * @returns Credential or HeadlessResult based on mode
106
+ */
107
+ invokeSecurePrompt(prepareResponse: PrepareResponse, options?: InvokeOptions | DesktopAuthOptions): Promise<SecureCredentialResponse['vp_token'] | HeadlessResult>;
108
+ /**
109
+ * Step 3A: Get phone number from credential
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * const prepareResp = await phoneAuthClient.preparePhoneRequest({ useCase: 'GetPhoneNumber', plmn: {...} });
114
+ * const credential = await phoneAuthClient.invokeSecurePrompt(prepareResp);
115
+ * const result = await phoneAuthClient.getPhoneNumber(credential, prepareResp.session);
116
+ * console.log(result.phone_number); // +1234567890
117
+ * ```
118
+ */
119
+ getPhoneNumber(credentialResponse: SecureCredentialResponse['vp_token'] | string, session: SessionInfo): Promise<GetPhoneNumberResponse>;
120
+ /**
121
+ * Step 3B: Verify phone number with credential
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * const prepareResp = await phoneAuthClient.preparePhoneRequest({
126
+ * useCase: 'VerifyPhoneNumber',
127
+ * phoneNumber: '+1234567890'
128
+ * });
129
+ * const credential = await phoneAuthClient.invokeSecurePrompt(prepareResp);
130
+ * const result = await phoneAuthClient.verifyPhoneNumber(credential, prepareResp.session);
131
+ * console.log(result.verified); // true
132
+ * ```
133
+ */
134
+ verifyPhoneNumber(credentialResponse: SecureCredentialResponse['vp_token'] | string, session: SessionInfo): Promise<VerifyPhoneNumberResponse>;
135
+ /**
136
+ * Helper to extract credential string from various formats
137
+ */
138
+ private extractCredentialString;
139
+ /**
140
+ * Helper to extract error details from response
141
+ */
142
+ private extractErrorDetails;
143
+ /**
144
+ * Fetch with timeout
145
+ */
146
+ private fetchWithTimeout;
147
+ /**
148
+ * Create an AuthError
149
+ */
150
+ private createError;
151
+ /**
152
+ * Type guard for AuthError
153
+ */
154
+ private isAuthError;
155
+ /**
156
+ * Debug logging
157
+ */
158
+ private log;
159
+ /**
160
+ * Determine if an error should trigger a retry
161
+ */
162
+ private shouldRetry;
163
+ /**
164
+ * Analyze and enhance errors specific to cross-device flows
165
+ */
166
+ private analyzeCrossDeviceError;
167
+ /**
168
+ * Cache successful session for retry scenarios
169
+ */
170
+ private cacheSession;
171
+ /**
172
+ * Retrieve cached session if available and recent
173
+ */
174
+ private getCachedSession;
175
+ /**
176
+ * Generate cache key for session storage
177
+ */
178
+ private getCacheKey;
179
+ /**
180
+ * Set up periodic cache cleanup
181
+ */
182
+ private setupCacheCleanup;
183
+ /**
184
+ * Utility delay function
185
+ */
186
+ private delay;
187
+ }