@koraidv/react 1.7.11 → 1.8.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.
package/dist/index.d.mts CHANGED
@@ -55,6 +55,16 @@ interface VerificationState {
55
55
  completedChallenges: number;
56
56
  isLoading: boolean;
57
57
  error: KoraError | null;
58
+ /**
59
+ * Transient feedback message for the last liveness challenge that
60
+ * the backend rejected. Set by submitChallenge when the server
61
+ * returns passed:false; LivenessScreen renders it inline so the
62
+ * user knows WHY their attempt failed (the v1.7.x behavior was to
63
+ * silently re-arm the same challenge — confusing). Cleared the
64
+ * moment the user moves to the next challenge or the same one
65
+ * passes on retry.
66
+ */
67
+ lastChallengeError: string | null;
58
68
  }
59
69
  /**
60
70
  * useKoraIDV hook return value
@@ -157,6 +167,13 @@ interface VerificationFlowProps {
157
167
  */
158
168
  expectedFirstName?: string;
159
169
  expectedLastName?: string;
170
+ /**
171
+ * Whether to render Visual Guide illustrations above the capture +
172
+ * liveness viewfinders (default true). Set false for a plain text-
173
+ * only flow. Matches the same flag iOS exposes via `showVisualGuides`
174
+ * on Configuration; Android has had it since v1.3.0.
175
+ */
176
+ showVisualGuides?: boolean;
160
177
  onComplete?: (verification: Verification) => void;
161
178
  onError?: (error: KoraError) => void;
162
179
  onCancel?: () => void;
@@ -166,7 +183,7 @@ interface VerificationFlowProps {
166
183
  /**
167
184
  * Complete verification flow component
168
185
  */
169
- declare function VerificationFlow({ externalId, tier, documentTypes, expectedFirstName, expectedLastName, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
186
+ declare function VerificationFlow({ externalId, tier, documentTypes, expectedFirstName, expectedLastName, showVisualGuides, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
170
187
 
171
188
  interface ConsentScreenProps {
172
189
  onAccept: () => void;
@@ -202,14 +219,18 @@ interface DocumentCaptureScreenProps {
202
219
  onQualityCheck?: (imageData: Blob) => Promise<DocumentQualityResponse>;
203
220
  onCapture: (imageData: Blob) => Promise<boolean>;
204
221
  onCancel: () => void;
222
+ /** Render Visual Guide illustration above the capture area (v1.8.0). */
223
+ showVisualGuides?: boolean;
205
224
  }
206
- declare function DocumentCaptureScreen({ side, documentType, requiresBack, onQualityCheck, onCapture, onCancel, }: DocumentCaptureScreenProps): react_jsx_runtime.JSX.Element;
225
+ declare function DocumentCaptureScreen({ side, documentType, requiresBack, onQualityCheck, onCapture, onCancel, showVisualGuides, }: DocumentCaptureScreenProps): react_jsx_runtime.JSX.Element;
207
226
 
208
227
  interface SelfieCaptureScreenProps {
209
228
  onCapture: (imageData: Blob) => Promise<boolean>;
210
229
  onCancel: () => void;
230
+ /** Render Visual Guide above the selfie viewfinder (v1.8.0). */
231
+ showVisualGuides?: boolean;
211
232
  }
212
- declare function SelfieCaptureScreen({ onCapture, onCancel }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
233
+ declare function SelfieCaptureScreen({ onCapture, onCancel, showVisualGuides }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
213
234
 
214
235
  interface LivenessScreenProps {
215
236
  session: LivenessSession | null;
@@ -219,6 +240,16 @@ interface LivenessScreenProps {
219
240
  onStart: () => Promise<void>;
220
241
  onComplete: () => Promise<any>;
221
242
  onCancel: () => void;
243
+ /**
244
+ * Inline retake feedback for the LAST attempt the backend rejected.
245
+ * Surfaced in the prompt card during the 'preparing' phase of the
246
+ * next attempt so the user knows what went wrong before they try
247
+ * again. Cleared by the hook when a challenge passes or a new
248
+ * challenge starts.
249
+ */
250
+ lastChallengeError?: string | null;
251
+ /** Render per-challenge VisualGuide above the instruction (v1.8.0). */
252
+ showVisualGuides?: boolean;
222
253
  }
223
254
  /**
224
255
  * Web liveness screen with a real front-facing camera.
@@ -251,7 +282,7 @@ interface LivenessScreenProps {
251
282
  * themselves against a countdown. Today's ship is "real camera, real
252
283
  * frames, server decides," which is the parity floor.
253
284
  */
254
- declare function LivenessScreen({ session, currentChallenge, completedChallenges, onChallengeComplete, onStart, onComplete, onCancel, }: LivenessScreenProps): react_jsx_runtime.JSX.Element;
285
+ declare function LivenessScreen({ session, currentChallenge, completedChallenges, onChallengeComplete, onStart, onComplete, onCancel, lastChallengeError, showVisualGuides, }: LivenessScreenProps): react_jsx_runtime.JSX.Element;
255
286
 
256
287
  type ResultPageMode = 'detailed' | 'simplified';
257
288
  interface ResultScreenProps {
@@ -338,8 +369,26 @@ interface ProcessingStep {
338
369
  status: 'done' | 'active' | 'pending';
339
370
  }
340
371
  interface ProcessingScreenProps {
341
- steps: ProcessingStep[];
372
+ /**
373
+ * Optional explicit steps. When provided, the screen renders them as-
374
+ * is (the v1.7.x behavior — kept for backwards compat with any caller
375
+ * passing a custom array).
376
+ */
377
+ steps?: ProcessingStep[];
378
+ /**
379
+ * When true (and `steps` is omitted), the screen auto-advances
380
+ * through a default 3-step sequence on a timer — the user sees
381
+ * "Document analyzed → Checking face match → Finalizing results"
382
+ * progress visually instead of a static screen. Each step transition
383
+ * is ~1.4s so the full sequence completes in ~4s, long enough to
384
+ * read but short enough that the typical sub-second backend
385
+ * `/complete` resolution still shows visible motion. Pre-v1.8.0 the
386
+ * labels were hardcoded with "Checking face match" pinned as
387
+ * 'active' regardless of actual progress — looked frozen on any
388
+ * processing window over ~500ms.
389
+ */
390
+ autoAdvance?: boolean;
342
391
  }
343
- declare function ProcessingScreen({ steps }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
392
+ declare function ProcessingScreen({ steps, autoAdvance }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
344
393
 
345
394
  export { ConsentScreen, type CountryInfo, CountrySelectionScreen, DocumentCaptureScreen, DocumentSelectionScreen, ErrorScreen, type KoraIDVContextValue, KoraIDVProvider, LivenessScreen, ProcessingScreen, QrHandoffScreen, ResultScreen, ScoreCard, ScoreMetricRow, SelfieCaptureScreen, StepProgressBar, VerificationFlow, type VerificationFlowProps, useKoraIDV };
package/dist/index.d.ts CHANGED
@@ -55,6 +55,16 @@ interface VerificationState {
55
55
  completedChallenges: number;
56
56
  isLoading: boolean;
57
57
  error: KoraError | null;
58
+ /**
59
+ * Transient feedback message for the last liveness challenge that
60
+ * the backend rejected. Set by submitChallenge when the server
61
+ * returns passed:false; LivenessScreen renders it inline so the
62
+ * user knows WHY their attempt failed (the v1.7.x behavior was to
63
+ * silently re-arm the same challenge — confusing). Cleared the
64
+ * moment the user moves to the next challenge or the same one
65
+ * passes on retry.
66
+ */
67
+ lastChallengeError: string | null;
58
68
  }
59
69
  /**
60
70
  * useKoraIDV hook return value
@@ -157,6 +167,13 @@ interface VerificationFlowProps {
157
167
  */
158
168
  expectedFirstName?: string;
159
169
  expectedLastName?: string;
170
+ /**
171
+ * Whether to render Visual Guide illustrations above the capture +
172
+ * liveness viewfinders (default true). Set false for a plain text-
173
+ * only flow. Matches the same flag iOS exposes via `showVisualGuides`
174
+ * on Configuration; Android has had it since v1.3.0.
175
+ */
176
+ showVisualGuides?: boolean;
160
177
  onComplete?: (verification: Verification) => void;
161
178
  onError?: (error: KoraError) => void;
162
179
  onCancel?: () => void;
@@ -166,7 +183,7 @@ interface VerificationFlowProps {
166
183
  /**
167
184
  * Complete verification flow component
168
185
  */
169
- declare function VerificationFlow({ externalId, tier, documentTypes, expectedFirstName, expectedLastName, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
186
+ declare function VerificationFlow({ externalId, tier, documentTypes, expectedFirstName, expectedLastName, showVisualGuides, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
170
187
 
171
188
  interface ConsentScreenProps {
172
189
  onAccept: () => void;
@@ -202,14 +219,18 @@ interface DocumentCaptureScreenProps {
202
219
  onQualityCheck?: (imageData: Blob) => Promise<DocumentQualityResponse>;
203
220
  onCapture: (imageData: Blob) => Promise<boolean>;
204
221
  onCancel: () => void;
222
+ /** Render Visual Guide illustration above the capture area (v1.8.0). */
223
+ showVisualGuides?: boolean;
205
224
  }
206
- declare function DocumentCaptureScreen({ side, documentType, requiresBack, onQualityCheck, onCapture, onCancel, }: DocumentCaptureScreenProps): react_jsx_runtime.JSX.Element;
225
+ declare function DocumentCaptureScreen({ side, documentType, requiresBack, onQualityCheck, onCapture, onCancel, showVisualGuides, }: DocumentCaptureScreenProps): react_jsx_runtime.JSX.Element;
207
226
 
208
227
  interface SelfieCaptureScreenProps {
209
228
  onCapture: (imageData: Blob) => Promise<boolean>;
210
229
  onCancel: () => void;
230
+ /** Render Visual Guide above the selfie viewfinder (v1.8.0). */
231
+ showVisualGuides?: boolean;
211
232
  }
212
- declare function SelfieCaptureScreen({ onCapture, onCancel }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
233
+ declare function SelfieCaptureScreen({ onCapture, onCancel, showVisualGuides }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
213
234
 
214
235
  interface LivenessScreenProps {
215
236
  session: LivenessSession | null;
@@ -219,6 +240,16 @@ interface LivenessScreenProps {
219
240
  onStart: () => Promise<void>;
220
241
  onComplete: () => Promise<any>;
221
242
  onCancel: () => void;
243
+ /**
244
+ * Inline retake feedback for the LAST attempt the backend rejected.
245
+ * Surfaced in the prompt card during the 'preparing' phase of the
246
+ * next attempt so the user knows what went wrong before they try
247
+ * again. Cleared by the hook when a challenge passes or a new
248
+ * challenge starts.
249
+ */
250
+ lastChallengeError?: string | null;
251
+ /** Render per-challenge VisualGuide above the instruction (v1.8.0). */
252
+ showVisualGuides?: boolean;
222
253
  }
223
254
  /**
224
255
  * Web liveness screen with a real front-facing camera.
@@ -251,7 +282,7 @@ interface LivenessScreenProps {
251
282
  * themselves against a countdown. Today's ship is "real camera, real
252
283
  * frames, server decides," which is the parity floor.
253
284
  */
254
- declare function LivenessScreen({ session, currentChallenge, completedChallenges, onChallengeComplete, onStart, onComplete, onCancel, }: LivenessScreenProps): react_jsx_runtime.JSX.Element;
285
+ declare function LivenessScreen({ session, currentChallenge, completedChallenges, onChallengeComplete, onStart, onComplete, onCancel, lastChallengeError, showVisualGuides, }: LivenessScreenProps): react_jsx_runtime.JSX.Element;
255
286
 
256
287
  type ResultPageMode = 'detailed' | 'simplified';
257
288
  interface ResultScreenProps {
@@ -338,8 +369,26 @@ interface ProcessingStep {
338
369
  status: 'done' | 'active' | 'pending';
339
370
  }
340
371
  interface ProcessingScreenProps {
341
- steps: ProcessingStep[];
372
+ /**
373
+ * Optional explicit steps. When provided, the screen renders them as-
374
+ * is (the v1.7.x behavior — kept for backwards compat with any caller
375
+ * passing a custom array).
376
+ */
377
+ steps?: ProcessingStep[];
378
+ /**
379
+ * When true (and `steps` is omitted), the screen auto-advances
380
+ * through a default 3-step sequence on a timer — the user sees
381
+ * "Document analyzed → Checking face match → Finalizing results"
382
+ * progress visually instead of a static screen. Each step transition
383
+ * is ~1.4s so the full sequence completes in ~4s, long enough to
384
+ * read but short enough that the typical sub-second backend
385
+ * `/complete` resolution still shows visible motion. Pre-v1.8.0 the
386
+ * labels were hardcoded with "Checking face match" pinned as
387
+ * 'active' regardless of actual progress — looked frozen on any
388
+ * processing window over ~500ms.
389
+ */
390
+ autoAdvance?: boolean;
342
391
  }
343
- declare function ProcessingScreen({ steps }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
392
+ declare function ProcessingScreen({ steps, autoAdvance }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
344
393
 
345
394
  export { ConsentScreen, type CountryInfo, CountrySelectionScreen, DocumentCaptureScreen, DocumentSelectionScreen, ErrorScreen, type KoraIDVContextValue, KoraIDVProvider, LivenessScreen, ProcessingScreen, QrHandoffScreen, ResultScreen, ScoreCard, ScoreMetricRow, SelfieCaptureScreen, StepProgressBar, VerificationFlow, type VerificationFlowProps, useKoraIDV };