@koraidv/core 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 CHANGED
@@ -292,6 +292,26 @@ declare class KoraError extends Error {
292
292
  interface CreateVerificationRequest {
293
293
  externalId: string;
294
294
  tier: string;
295
+ /**
296
+ * Expected first name for name-match scoring. When set, the backend
297
+ * compares the OCR'd given name on the document against this value
298
+ * and surfaces a real `scores.nameMatch` percentage; when unset,
299
+ * nameMatch is 0 and the ResultScreen's "Name Match" row shows FAIL
300
+ * on otherwise-approved verifications. Optional — integrators that
301
+ * don't have the user's claimed legal name (or don't care) can
302
+ * omit. Mirrors iOS's `CreateVerificationRequest.expectedFirstName`.
303
+ */
304
+ expectedFirstName?: string;
305
+ /** Expected last name. See `expectedFirstName` for semantics. */
306
+ expectedLastName?: string;
307
+ /**
308
+ * Optional integrator-supplied metadata. The Web SDK ALWAYS adds
309
+ * `source: 'web'` so the backend's source-aware threshold tuning
310
+ * (v1.8.0+) can apply the right floors for webcam-captured selfies.
311
+ * Anything the integrator passes here is merged on top of the
312
+ * SDK-set `source` key.
313
+ */
314
+ metadata?: Record<string, unknown>;
295
315
  }
296
316
  /**
297
317
  * Document upload response
@@ -421,6 +441,14 @@ interface VerificationOptions {
421
441
  externalId: string;
422
442
  tier?: 'basic' | 'standard' | 'enhanced';
423
443
  documentTypes?: DocumentType[];
444
+ /**
445
+ * Optional name-match inputs. When set, the backend compares the
446
+ * OCR'd names on the document against these values and surfaces a
447
+ * real `scores.nameMatch` percentage on the verification result.
448
+ * Mirrors iOS's startVerification(expectedFirstName:expectedLastName:).
449
+ */
450
+ expectedFirstName?: string;
451
+ expectedLastName?: string;
424
452
  }
425
453
  /**
426
454
  * Verification step
package/dist/index.d.ts CHANGED
@@ -292,6 +292,26 @@ declare class KoraError extends Error {
292
292
  interface CreateVerificationRequest {
293
293
  externalId: string;
294
294
  tier: string;
295
+ /**
296
+ * Expected first name for name-match scoring. When set, the backend
297
+ * compares the OCR'd given name on the document against this value
298
+ * and surfaces a real `scores.nameMatch` percentage; when unset,
299
+ * nameMatch is 0 and the ResultScreen's "Name Match" row shows FAIL
300
+ * on otherwise-approved verifications. Optional — integrators that
301
+ * don't have the user's claimed legal name (or don't care) can
302
+ * omit. Mirrors iOS's `CreateVerificationRequest.expectedFirstName`.
303
+ */
304
+ expectedFirstName?: string;
305
+ /** Expected last name. See `expectedFirstName` for semantics. */
306
+ expectedLastName?: string;
307
+ /**
308
+ * Optional integrator-supplied metadata. The Web SDK ALWAYS adds
309
+ * `source: 'web'` so the backend's source-aware threshold tuning
310
+ * (v1.8.0+) can apply the right floors for webcam-captured selfies.
311
+ * Anything the integrator passes here is merged on top of the
312
+ * SDK-set `source` key.
313
+ */
314
+ metadata?: Record<string, unknown>;
295
315
  }
296
316
  /**
297
317
  * Document upload response
@@ -421,6 +441,14 @@ interface VerificationOptions {
421
441
  externalId: string;
422
442
  tier?: 'basic' | 'standard' | 'enhanced';
423
443
  documentTypes?: DocumentType[];
444
+ /**
445
+ * Optional name-match inputs. When set, the backend compares the
446
+ * OCR'd names on the document against these values and surfaces a
447
+ * real `scores.nameMatch` percentage on the verification result.
448
+ * Mirrors iOS's startVerification(expectedFirstName:expectedLastName:).
449
+ */
450
+ expectedFirstName?: string;
451
+ expectedLastName?: string;
424
452
  }
425
453
  /**
426
454
  * Verification step
package/dist/index.js CHANGED
@@ -572,7 +572,25 @@ var ApiClient = class {
572
572
  method: "POST",
573
573
  body: JSON.stringify({
574
574
  externalId: request.externalId,
575
- tier: request.tier
575
+ tier: request.tier,
576
+ // Optional name-match inputs — only sent when the integrator
577
+ // provided them, so older call sites don't accidentally start
578
+ // emitting empty strings (backend's name-match logic treats
579
+ // "" as "user has no claimed name" same as missing).
580
+ expectedFirstName: request.expectedFirstName,
581
+ expectedLastName: request.expectedLastName,
582
+ // Source signal for backend's source-aware threshold tuning
583
+ // (v1.8.0). Backend's EffectiveForSource(source) relaxes the
584
+ // MinFaceMatchScore + MinLivenessScore floors by 10 each when
585
+ // source="web" — webcam captures consistently score lower than
586
+ // native mobile camera captures, and the strict mobile-
587
+ // calibrated floor false-rejects perfectly real users. Carried
588
+ // in `metadata` to avoid a schema migration on the backend;
589
+ // any other integrator-supplied metadata is merged on top.
590
+ metadata: {
591
+ source: "web",
592
+ ...request.metadata ?? {}
593
+ }
576
594
  })
577
595
  });
578
596
  }
@@ -916,7 +934,9 @@ var KoraIDV = class {
916
934
  this.sessionStartTime = /* @__PURE__ */ new Date();
917
935
  const verification = await this.apiClient.createVerification({
918
936
  externalId: options.externalId,
919
- tier: options.tier ?? "standard"
937
+ tier: options.tier ?? "standard",
938
+ expectedFirstName: options.expectedFirstName,
939
+ expectedLastName: options.expectedLastName
920
940
  });
921
941
  this.currentVerification = verification;
922
942
  callbacks.onStepChange?.("consent");
@@ -1001,8 +1021,8 @@ var KoraIDV = class {
1001
1021
  imageData
1002
1022
  );
1003
1023
  return {
1004
- passed: response.challengePassed,
1005
- remainingChallenges: response.remainingChallenges
1024
+ passed: response.challengePassed ?? false,
1025
+ remainingChallenges: response.remainingChallenges ?? 0
1006
1026
  };
1007
1027
  }
1008
1028
  /**
package/dist/index.mjs CHANGED
@@ -528,7 +528,25 @@ var ApiClient = class {
528
528
  method: "POST",
529
529
  body: JSON.stringify({
530
530
  externalId: request.externalId,
531
- tier: request.tier
531
+ tier: request.tier,
532
+ // Optional name-match inputs — only sent when the integrator
533
+ // provided them, so older call sites don't accidentally start
534
+ // emitting empty strings (backend's name-match logic treats
535
+ // "" as "user has no claimed name" same as missing).
536
+ expectedFirstName: request.expectedFirstName,
537
+ expectedLastName: request.expectedLastName,
538
+ // Source signal for backend's source-aware threshold tuning
539
+ // (v1.8.0). Backend's EffectiveForSource(source) relaxes the
540
+ // MinFaceMatchScore + MinLivenessScore floors by 10 each when
541
+ // source="web" — webcam captures consistently score lower than
542
+ // native mobile camera captures, and the strict mobile-
543
+ // calibrated floor false-rejects perfectly real users. Carried
544
+ // in `metadata` to avoid a schema migration on the backend;
545
+ // any other integrator-supplied metadata is merged on top.
546
+ metadata: {
547
+ source: "web",
548
+ ...request.metadata ?? {}
549
+ }
532
550
  })
533
551
  });
534
552
  }
@@ -872,7 +890,9 @@ var KoraIDV = class {
872
890
  this.sessionStartTime = /* @__PURE__ */ new Date();
873
891
  const verification = await this.apiClient.createVerification({
874
892
  externalId: options.externalId,
875
- tier: options.tier ?? "standard"
893
+ tier: options.tier ?? "standard",
894
+ expectedFirstName: options.expectedFirstName,
895
+ expectedLastName: options.expectedLastName
876
896
  });
877
897
  this.currentVerification = verification;
878
898
  callbacks.onStepChange?.("consent");
@@ -957,8 +977,8 @@ var KoraIDV = class {
957
977
  imageData
958
978
  );
959
979
  return {
960
- passed: response.challengePassed,
961
- remainingChallenges: response.remainingChallenges
980
+ passed: response.challengePassed ?? false,
981
+ remainingChallenges: response.remainingChallenges ?? 0
962
982
  };
963
983
  }
964
984
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koraidv/core",
3
- "version": "1.7.10",
3
+ "version": "1.8.0",
4
4
  "description": "Kora IDV Core SDK - API Client and Utilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",