@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,203 @@
1
+ /**
2
+ * Glide Phone Authentication API Types
3
+ *
4
+ * This file is copied from the master API specification at /glide-api-types.ts
5
+ * It defines the exact contract that ALL implementations must follow.
6
+ *
7
+ * NAMING CONVENTION:
8
+ * - ALL TYPES USE snake_case FOR API COMMUNICATION
9
+ * - Frontend SDKs should use snake_case throughout for consistency
10
+ * - This eliminates conversion errors and makes debugging easier
11
+ * - While not idiomatic JavaScript, it matches the API exactly
12
+ */
13
+ // ============================================================================
14
+ // USE CASES
15
+ // ============================================================================
16
+ export const USE_CASE = {
17
+ GET_PHONE_NUMBER: 'GetPhoneNumber',
18
+ VERIFY_PHONE_NUMBER: 'VerifyPhoneNumber'
19
+ };
20
+ // ============================================================================
21
+ // AUTHENTICATION STRATEGIES
22
+ // ============================================================================
23
+ export const AUTHENTICATION_STRATEGY = {
24
+ TS43: 'ts43',
25
+ LINK: 'link',
26
+ DESKTOP: 'desktop'
27
+ };
28
+ // ============================================================================
29
+ // ERROR HANDLING
30
+ // ============================================================================
31
+ /**
32
+ * Error codes - MUST match server implementation
33
+ */
34
+ export const ERROR_CODE = {
35
+ // 400 Bad Request
36
+ INVALID_PHONE_NUMBER: 'INVALID_PHONE_NUMBER',
37
+ MISSING_REQUIRED_FIELD: 'MISSING_REQUIRED_FIELD',
38
+ INVALID_USE_CASE: 'INVALID_USE_CASE',
39
+ // 404 Not Found
40
+ INVALID_SESSION: 'INVALID_SESSION',
41
+ SESSION_EXPIRED: 'SESSION_EXPIRED',
42
+ // 422 Unprocessable Entity
43
+ CARRIER_NOT_ELIGIBLE: 'CARRIER_NOT_ELIGIBLE',
44
+ UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM',
45
+ PHONE_NUMBER_MISMATCH: 'PHONE_NUMBER_MISMATCH',
46
+ INVALID_CREDENTIAL: 'INVALID_CREDENTIAL',
47
+ VERIFICATION_FAILED: 'VERIFICATION_FAILED',
48
+ USE_CASE_MISMATCH: 'USE_CASE_MISMATCH',
49
+ // 429 Too Many Requests
50
+ RATE_LIMIT_EXCEEDED: 'RATE_LIMIT_EXCEEDED',
51
+ // 500 Internal Server Error
52
+ INTERNAL_SERVER_ERROR: 'INTERNAL_SERVER_ERROR',
53
+ // 503 Service Unavailable
54
+ SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE'
55
+ };
56
+ /**
57
+ * Error messages - User-friendly messages for each error code
58
+ */
59
+ export const ERROR_MESSAGES = {
60
+ [ERROR_CODE.INVALID_PHONE_NUMBER]: "Phone number must be in E.164 format",
61
+ [ERROR_CODE.MISSING_REQUIRED_FIELD]: "Required field is missing",
62
+ [ERROR_CODE.INVALID_USE_CASE]: "Use case must be 'GetPhoneNumber' or 'VerifyPhoneNumber'",
63
+ [ERROR_CODE.INVALID_SESSION]: "Session not found or expired",
64
+ [ERROR_CODE.SESSION_EXPIRED]: "Session has expired",
65
+ [ERROR_CODE.CARRIER_NOT_ELIGIBLE]: "Your carrier does not support this verification method",
66
+ [ERROR_CODE.UNSUPPORTED_PLATFORM]: "Your platform is not supported",
67
+ [ERROR_CODE.PHONE_NUMBER_MISMATCH]: "Phone number does not match the device",
68
+ [ERROR_CODE.INVALID_CREDENTIAL]: "Invalid or expired credential",
69
+ [ERROR_CODE.VERIFICATION_FAILED]: "Phone number verification failed",
70
+ [ERROR_CODE.USE_CASE_MISMATCH]: "Session was prepared for a different use case",
71
+ [ERROR_CODE.RATE_LIMIT_EXCEEDED]: "Too many requests. Please try again later",
72
+ [ERROR_CODE.INTERNAL_SERVER_ERROR]: "An unexpected error occurred",
73
+ [ERROR_CODE.SERVICE_UNAVAILABLE]: "Service temporarily unavailable"
74
+ };
75
+ /**
76
+ * HTTP status codes for each error
77
+ */
78
+ export const ERROR_STATUS_CODES = {
79
+ [ERROR_CODE.INVALID_PHONE_NUMBER]: 400,
80
+ [ERROR_CODE.MISSING_REQUIRED_FIELD]: 400,
81
+ [ERROR_CODE.INVALID_USE_CASE]: 400,
82
+ [ERROR_CODE.INVALID_SESSION]: 404,
83
+ [ERROR_CODE.SESSION_EXPIRED]: 404,
84
+ [ERROR_CODE.CARRIER_NOT_ELIGIBLE]: 422,
85
+ [ERROR_CODE.UNSUPPORTED_PLATFORM]: 422,
86
+ [ERROR_CODE.PHONE_NUMBER_MISMATCH]: 422,
87
+ [ERROR_CODE.INVALID_CREDENTIAL]: 422,
88
+ [ERROR_CODE.VERIFICATION_FAILED]: 422,
89
+ [ERROR_CODE.USE_CASE_MISMATCH]: 422,
90
+ [ERROR_CODE.RATE_LIMIT_EXCEEDED]: 429,
91
+ [ERROR_CODE.INTERNAL_SERVER_ERROR]: 500,
92
+ [ERROR_CODE.SERVICE_UNAVAILABLE]: 503
93
+ };
94
+ // ============================================================================
95
+ // VALIDATION HELPERS
96
+ // ============================================================================
97
+ /**
98
+ * E.164 phone number validation regex
99
+ */
100
+ export const E164_REGEX = /^\+[1-9]\d{1,14}$/;
101
+ /**
102
+ * Validate phone number format
103
+ */
104
+ export function validatePhoneNumber(phone) {
105
+ return E164_REGEX.test(phone);
106
+ }
107
+ /**
108
+ * Validate PLMN format
109
+ */
110
+ export function validatePLMN(plmn) {
111
+ // MCC: exactly 3 digits
112
+ if (!/^\d{3}$/.test(plmn.mcc))
113
+ return false;
114
+ // MNC: 2 or 3 digits
115
+ if (!/^\d{2,3}$/.test(plmn.mnc))
116
+ return false;
117
+ return true;
118
+ }
119
+ /**
120
+ * Validate session info
121
+ */
122
+ export function validateSession(session) {
123
+ if (!session.session_key || session.session_key.length < 16)
124
+ return false;
125
+ // nonce and enc_key are optional and stored in metadata if needed
126
+ return true;
127
+ }
128
+ /**
129
+ * Validate use case
130
+ */
131
+ export function validateUseCase(useCase) {
132
+ return useCase === USE_CASE.GET_PHONE_NUMBER ||
133
+ useCase === USE_CASE.VERIFY_PHONE_NUMBER;
134
+ }
135
+ /**
136
+ * Create error response helper
137
+ */
138
+ export function createErrorResponse(code, details, requestId) {
139
+ return {
140
+ code,
141
+ message: ERROR_MESSAGES[code],
142
+ request_id: requestId,
143
+ timestamp: new Date().toISOString(),
144
+ details
145
+ };
146
+ }
147
+ /**
148
+ * Get HTTP status code for error
149
+ */
150
+ export function getErrorStatusCode(code) {
151
+ return ERROR_STATUS_CODES[code] || 500;
152
+ }
153
+ // ============================================================================
154
+ // TYPE GUARDS
155
+ // ============================================================================
156
+ /**
157
+ * Check if data is TS43 strategy data
158
+ */
159
+ export function isTS43Data(data) {
160
+ // Check for TS43 data structure - has protocol and data.dcql_query
161
+ return data &&
162
+ typeof data.protocol === 'string' &&
163
+ data.data &&
164
+ data.data.dcql_query;
165
+ }
166
+ /**
167
+ * Check if data is Link strategy data
168
+ */
169
+ export function isLinkData(data) {
170
+ return data && data.url && typeof data.url === 'string';
171
+ }
172
+ /**
173
+ * Check if response is an error
174
+ */
175
+ export function isErrorResponse(response) {
176
+ return response &&
177
+ typeof response.code === 'string' &&
178
+ typeof response.message === 'string';
179
+ }
180
+ // ============================================================================
181
+ // EXPORTS FOR CONVENIENCE
182
+ // ============================================================================
183
+ export default {
184
+ // Constants
185
+ USE_CASE,
186
+ AUTHENTICATION_STRATEGY,
187
+ ERROR_CODE,
188
+ ERROR_MESSAGES,
189
+ ERROR_STATUS_CODES,
190
+ E164_REGEX,
191
+ // Validators
192
+ validatePhoneNumber,
193
+ validatePLMN,
194
+ validateSession,
195
+ validateUseCase,
196
+ // Type guards
197
+ isTS43Data,
198
+ isLinkData,
199
+ isErrorResponse,
200
+ // Helpers
201
+ createErrorResponse,
202
+ getErrorStatusCode
203
+ };
@@ -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
+ }