@koraidv/react 1.7.10 → 1.8.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.mts +71 -7
- package/dist/index.d.ts +71 -7
- package/dist/index.js +830 -381
- package/dist/index.mjs +833 -384
- package/package.json +2 -2
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
|
|
@@ -67,7 +77,7 @@ interface UseKoraIDVReturn {
|
|
|
67
77
|
/**
|
|
68
78
|
* Start a new verification
|
|
69
79
|
*/
|
|
70
|
-
startVerification: (externalId: string, tier?: string) => Promise<void>;
|
|
80
|
+
startVerification: (externalId: string, tier?: string, expectedFirstName?: string, expectedLastName?: string) => Promise<void>;
|
|
71
81
|
/**
|
|
72
82
|
* Resume an existing verification
|
|
73
83
|
*/
|
|
@@ -142,6 +152,28 @@ interface VerificationFlowProps {
|
|
|
142
152
|
externalId: string;
|
|
143
153
|
tier?: 'basic' | 'standard' | 'enhanced';
|
|
144
154
|
documentTypes?: DocumentType[];
|
|
155
|
+
/**
|
|
156
|
+
* Optional name-match inputs. When set, the backend compares the
|
|
157
|
+
* OCR'd names on the document against these values and surfaces a
|
|
158
|
+
* real `scores.nameMatch` percentage on the verification result —
|
|
159
|
+
* the ResultScreen's "Name Match" row shows real PASS/FAIL instead
|
|
160
|
+
* of the always-0% / always-FAIL it shows when these aren't passed.
|
|
161
|
+
*
|
|
162
|
+
* Wire from your user record at mount time, e.g.
|
|
163
|
+
* `<VerificationFlow expectedFirstName={user.firstName} ... />`
|
|
164
|
+
*
|
|
165
|
+
* Mirrors iOS's
|
|
166
|
+
* `KoraIDV.startVerification(expectedFirstName:expectedLastName:)`.
|
|
167
|
+
*/
|
|
168
|
+
expectedFirstName?: string;
|
|
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;
|
|
145
177
|
onComplete?: (verification: Verification) => void;
|
|
146
178
|
onError?: (error: KoraError) => void;
|
|
147
179
|
onCancel?: () => void;
|
|
@@ -151,7 +183,7 @@ interface VerificationFlowProps {
|
|
|
151
183
|
/**
|
|
152
184
|
* Complete verification flow component
|
|
153
185
|
*/
|
|
154
|
-
declare function VerificationFlow({ externalId, tier, documentTypes, 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;
|
|
155
187
|
|
|
156
188
|
interface ConsentScreenProps {
|
|
157
189
|
onAccept: () => void;
|
|
@@ -187,14 +219,18 @@ interface DocumentCaptureScreenProps {
|
|
|
187
219
|
onQualityCheck?: (imageData: Blob) => Promise<DocumentQualityResponse>;
|
|
188
220
|
onCapture: (imageData: Blob) => Promise<boolean>;
|
|
189
221
|
onCancel: () => void;
|
|
222
|
+
/** Render Visual Guide illustration above the capture area (v1.8.0). */
|
|
223
|
+
showVisualGuides?: boolean;
|
|
190
224
|
}
|
|
191
|
-
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;
|
|
192
226
|
|
|
193
227
|
interface SelfieCaptureScreenProps {
|
|
194
228
|
onCapture: (imageData: Blob) => Promise<boolean>;
|
|
195
229
|
onCancel: () => void;
|
|
230
|
+
/** Render Visual Guide above the selfie viewfinder (v1.8.0). */
|
|
231
|
+
showVisualGuides?: boolean;
|
|
196
232
|
}
|
|
197
|
-
declare function SelfieCaptureScreen({ onCapture, onCancel }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
declare function SelfieCaptureScreen({ onCapture, onCancel, showVisualGuides }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
|
|
198
234
|
|
|
199
235
|
interface LivenessScreenProps {
|
|
200
236
|
session: LivenessSession | null;
|
|
@@ -204,6 +240,16 @@ interface LivenessScreenProps {
|
|
|
204
240
|
onStart: () => Promise<void>;
|
|
205
241
|
onComplete: () => Promise<any>;
|
|
206
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;
|
|
207
253
|
}
|
|
208
254
|
/**
|
|
209
255
|
* Web liveness screen with a real front-facing camera.
|
|
@@ -236,7 +282,7 @@ interface LivenessScreenProps {
|
|
|
236
282
|
* themselves against a countdown. Today's ship is "real camera, real
|
|
237
283
|
* frames, server decides," which is the parity floor.
|
|
238
284
|
*/
|
|
239
|
-
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;
|
|
240
286
|
|
|
241
287
|
type ResultPageMode = 'detailed' | 'simplified';
|
|
242
288
|
interface ResultScreenProps {
|
|
@@ -323,8 +369,26 @@ interface ProcessingStep {
|
|
|
323
369
|
status: 'done' | 'active' | 'pending';
|
|
324
370
|
}
|
|
325
371
|
interface ProcessingScreenProps {
|
|
326
|
-
|
|
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;
|
|
327
391
|
}
|
|
328
|
-
declare function ProcessingScreen({ steps }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
|
|
392
|
+
declare function ProcessingScreen({ steps, autoAdvance }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
|
|
329
393
|
|
|
330
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
|
|
@@ -67,7 +77,7 @@ interface UseKoraIDVReturn {
|
|
|
67
77
|
/**
|
|
68
78
|
* Start a new verification
|
|
69
79
|
*/
|
|
70
|
-
startVerification: (externalId: string, tier?: string) => Promise<void>;
|
|
80
|
+
startVerification: (externalId: string, tier?: string, expectedFirstName?: string, expectedLastName?: string) => Promise<void>;
|
|
71
81
|
/**
|
|
72
82
|
* Resume an existing verification
|
|
73
83
|
*/
|
|
@@ -142,6 +152,28 @@ interface VerificationFlowProps {
|
|
|
142
152
|
externalId: string;
|
|
143
153
|
tier?: 'basic' | 'standard' | 'enhanced';
|
|
144
154
|
documentTypes?: DocumentType[];
|
|
155
|
+
/**
|
|
156
|
+
* Optional name-match inputs. When set, the backend compares the
|
|
157
|
+
* OCR'd names on the document against these values and surfaces a
|
|
158
|
+
* real `scores.nameMatch` percentage on the verification result —
|
|
159
|
+
* the ResultScreen's "Name Match" row shows real PASS/FAIL instead
|
|
160
|
+
* of the always-0% / always-FAIL it shows when these aren't passed.
|
|
161
|
+
*
|
|
162
|
+
* Wire from your user record at mount time, e.g.
|
|
163
|
+
* `<VerificationFlow expectedFirstName={user.firstName} ... />`
|
|
164
|
+
*
|
|
165
|
+
* Mirrors iOS's
|
|
166
|
+
* `KoraIDV.startVerification(expectedFirstName:expectedLastName:)`.
|
|
167
|
+
*/
|
|
168
|
+
expectedFirstName?: string;
|
|
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;
|
|
145
177
|
onComplete?: (verification: Verification) => void;
|
|
146
178
|
onError?: (error: KoraError) => void;
|
|
147
179
|
onCancel?: () => void;
|
|
@@ -151,7 +183,7 @@ interface VerificationFlowProps {
|
|
|
151
183
|
/**
|
|
152
184
|
* Complete verification flow component
|
|
153
185
|
*/
|
|
154
|
-
declare function VerificationFlow({ externalId, tier, documentTypes, 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;
|
|
155
187
|
|
|
156
188
|
interface ConsentScreenProps {
|
|
157
189
|
onAccept: () => void;
|
|
@@ -187,14 +219,18 @@ interface DocumentCaptureScreenProps {
|
|
|
187
219
|
onQualityCheck?: (imageData: Blob) => Promise<DocumentQualityResponse>;
|
|
188
220
|
onCapture: (imageData: Blob) => Promise<boolean>;
|
|
189
221
|
onCancel: () => void;
|
|
222
|
+
/** Render Visual Guide illustration above the capture area (v1.8.0). */
|
|
223
|
+
showVisualGuides?: boolean;
|
|
190
224
|
}
|
|
191
|
-
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;
|
|
192
226
|
|
|
193
227
|
interface SelfieCaptureScreenProps {
|
|
194
228
|
onCapture: (imageData: Blob) => Promise<boolean>;
|
|
195
229
|
onCancel: () => void;
|
|
230
|
+
/** Render Visual Guide above the selfie viewfinder (v1.8.0). */
|
|
231
|
+
showVisualGuides?: boolean;
|
|
196
232
|
}
|
|
197
|
-
declare function SelfieCaptureScreen({ onCapture, onCancel }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
declare function SelfieCaptureScreen({ onCapture, onCancel, showVisualGuides }: SelfieCaptureScreenProps): react_jsx_runtime.JSX.Element;
|
|
198
234
|
|
|
199
235
|
interface LivenessScreenProps {
|
|
200
236
|
session: LivenessSession | null;
|
|
@@ -204,6 +240,16 @@ interface LivenessScreenProps {
|
|
|
204
240
|
onStart: () => Promise<void>;
|
|
205
241
|
onComplete: () => Promise<any>;
|
|
206
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;
|
|
207
253
|
}
|
|
208
254
|
/**
|
|
209
255
|
* Web liveness screen with a real front-facing camera.
|
|
@@ -236,7 +282,7 @@ interface LivenessScreenProps {
|
|
|
236
282
|
* themselves against a countdown. Today's ship is "real camera, real
|
|
237
283
|
* frames, server decides," which is the parity floor.
|
|
238
284
|
*/
|
|
239
|
-
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;
|
|
240
286
|
|
|
241
287
|
type ResultPageMode = 'detailed' | 'simplified';
|
|
242
288
|
interface ResultScreenProps {
|
|
@@ -323,8 +369,26 @@ interface ProcessingStep {
|
|
|
323
369
|
status: 'done' | 'active' | 'pending';
|
|
324
370
|
}
|
|
325
371
|
interface ProcessingScreenProps {
|
|
326
|
-
|
|
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;
|
|
327
391
|
}
|
|
328
|
-
declare function ProcessingScreen({ steps }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
|
|
392
|
+
declare function ProcessingScreen({ steps, autoAdvance }: ProcessingScreenProps): react_jsx_runtime.JSX.Element;
|
|
329
393
|
|
|
330
394
|
export { ConsentScreen, type CountryInfo, CountrySelectionScreen, DocumentCaptureScreen, DocumentSelectionScreen, ErrorScreen, type KoraIDVContextValue, KoraIDVProvider, LivenessScreen, ProcessingScreen, QrHandoffScreen, ResultScreen, ScoreCard, ScoreMetricRow, SelfieCaptureScreen, StepProgressBar, VerificationFlow, type VerificationFlowProps, useKoraIDV };
|