@koraidv/react 1.7.10 → 1.7.11

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
@@ -67,7 +67,7 @@ interface UseKoraIDVReturn {
67
67
  /**
68
68
  * Start a new verification
69
69
  */
70
- startVerification: (externalId: string, tier?: string) => Promise<void>;
70
+ startVerification: (externalId: string, tier?: string, expectedFirstName?: string, expectedLastName?: string) => Promise<void>;
71
71
  /**
72
72
  * Resume an existing verification
73
73
  */
@@ -142,6 +142,21 @@ interface VerificationFlowProps {
142
142
  externalId: string;
143
143
  tier?: 'basic' | 'standard' | 'enhanced';
144
144
  documentTypes?: DocumentType[];
145
+ /**
146
+ * Optional name-match inputs. When set, the backend compares the
147
+ * OCR'd names on the document against these values and surfaces a
148
+ * real `scores.nameMatch` percentage on the verification result —
149
+ * the ResultScreen's "Name Match" row shows real PASS/FAIL instead
150
+ * of the always-0% / always-FAIL it shows when these aren't passed.
151
+ *
152
+ * Wire from your user record at mount time, e.g.
153
+ * `<VerificationFlow expectedFirstName={user.firstName} ... />`
154
+ *
155
+ * Mirrors iOS's
156
+ * `KoraIDV.startVerification(expectedFirstName:expectedLastName:)`.
157
+ */
158
+ expectedFirstName?: string;
159
+ expectedLastName?: string;
145
160
  onComplete?: (verification: Verification) => void;
146
161
  onError?: (error: KoraError) => void;
147
162
  onCancel?: () => void;
@@ -151,7 +166,7 @@ interface VerificationFlowProps {
151
166
  /**
152
167
  * Complete verification flow component
153
168
  */
154
- declare function VerificationFlow({ externalId, tier, documentTypes, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
169
+ declare function VerificationFlow({ externalId, tier, documentTypes, expectedFirstName, expectedLastName, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
155
170
 
156
171
  interface ConsentScreenProps {
157
172
  onAccept: () => void;
package/dist/index.d.ts CHANGED
@@ -67,7 +67,7 @@ interface UseKoraIDVReturn {
67
67
  /**
68
68
  * Start a new verification
69
69
  */
70
- startVerification: (externalId: string, tier?: string) => Promise<void>;
70
+ startVerification: (externalId: string, tier?: string, expectedFirstName?: string, expectedLastName?: string) => Promise<void>;
71
71
  /**
72
72
  * Resume an existing verification
73
73
  */
@@ -142,6 +142,21 @@ interface VerificationFlowProps {
142
142
  externalId: string;
143
143
  tier?: 'basic' | 'standard' | 'enhanced';
144
144
  documentTypes?: DocumentType[];
145
+ /**
146
+ * Optional name-match inputs. When set, the backend compares the
147
+ * OCR'd names on the document against these values and surfaces a
148
+ * real `scores.nameMatch` percentage on the verification result —
149
+ * the ResultScreen's "Name Match" row shows real PASS/FAIL instead
150
+ * of the always-0% / always-FAIL it shows when these aren't passed.
151
+ *
152
+ * Wire from your user record at mount time, e.g.
153
+ * `<VerificationFlow expectedFirstName={user.firstName} ... />`
154
+ *
155
+ * Mirrors iOS's
156
+ * `KoraIDV.startVerification(expectedFirstName:expectedLastName:)`.
157
+ */
158
+ expectedFirstName?: string;
159
+ expectedLastName?: string;
145
160
  onComplete?: (verification: Verification) => void;
146
161
  onError?: (error: KoraError) => void;
147
162
  onCancel?: () => void;
@@ -151,7 +166,7 @@ interface VerificationFlowProps {
151
166
  /**
152
167
  * Complete verification flow component
153
168
  */
154
- declare function VerificationFlow({ externalId, tier, documentTypes, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
169
+ declare function VerificationFlow({ externalId, tier, documentTypes, expectedFirstName, expectedLastName, onComplete, onError, onCancel, className, style, }: VerificationFlowProps): react_jsx_runtime.JSX.Element;
155
170
 
156
171
  interface ConsentScreenProps {
157
172
  onAccept: () => void;
package/dist/index.js CHANGED
@@ -101,11 +101,16 @@ function useKoraIDV() {
101
101
  const [selectedDocumentType, setSelectedDocumentType] = (0, import_react2.useState)(null);
102
102
  const [documentFrontCaptured, setDocumentFrontCaptured] = (0, import_react2.useState)(false);
103
103
  const startVerification = (0, import_react2.useCallback)(
104
- async (externalId, tier = "standard") => {
104
+ async (externalId, tier = "standard", expectedFirstName, expectedLastName) => {
105
105
  setState((prev) => ({ ...prev, isLoading: true, error: null }));
106
106
  try {
107
107
  await sdk.startVerification(
108
- { externalId, tier },
108
+ {
109
+ externalId,
110
+ tier,
111
+ expectedFirstName,
112
+ expectedLastName
113
+ },
109
114
  {
110
115
  onStepChange: (step) => {
111
116
  setState((prev) => ({ ...prev, step }));
@@ -3042,6 +3047,8 @@ function VerificationFlow({
3042
3047
  externalId,
3043
3048
  tier = "standard",
3044
3049
  documentTypes,
3050
+ expectedFirstName,
3051
+ expectedLastName,
3045
3052
  onComplete,
3046
3053
  onError,
3047
3054
  onCancel,
@@ -3074,8 +3081,8 @@ function VerificationFlow({
3074
3081
  }
3075
3082
  }, [state.step]);
3076
3083
  (0, import_react10.useEffect)(() => {
3077
- startVerification(externalId, tier);
3078
- }, [externalId, tier, startVerification]);
3084
+ startVerification(externalId, tier, expectedFirstName, expectedLastName);
3085
+ }, [externalId, tier, expectedFirstName, expectedLastName, startVerification]);
3079
3086
  (0, import_react10.useEffect)(() => {
3080
3087
  if (state.error && onError) {
3081
3088
  onError(state.error);
package/dist/index.mjs CHANGED
@@ -52,11 +52,16 @@ function useKoraIDV() {
52
52
  const [selectedDocumentType, setSelectedDocumentType] = useState(null);
53
53
  const [documentFrontCaptured, setDocumentFrontCaptured] = useState(false);
54
54
  const startVerification = useCallback(
55
- async (externalId, tier = "standard") => {
55
+ async (externalId, tier = "standard", expectedFirstName, expectedLastName) => {
56
56
  setState((prev) => ({ ...prev, isLoading: true, error: null }));
57
57
  try {
58
58
  await sdk.startVerification(
59
- { externalId, tier },
59
+ {
60
+ externalId,
61
+ tier,
62
+ expectedFirstName,
63
+ expectedLastName
64
+ },
60
65
  {
61
66
  onStepChange: (step) => {
62
67
  setState((prev) => ({ ...prev, step }));
@@ -2993,6 +2998,8 @@ function VerificationFlow({
2993
2998
  externalId,
2994
2999
  tier = "standard",
2995
3000
  documentTypes,
3001
+ expectedFirstName,
3002
+ expectedLastName,
2996
3003
  onComplete,
2997
3004
  onError,
2998
3005
  onCancel,
@@ -3025,8 +3032,8 @@ function VerificationFlow({
3025
3032
  }
3026
3033
  }, [state.step]);
3027
3034
  useEffect8(() => {
3028
- startVerification(externalId, tier);
3029
- }, [externalId, tier, startVerification]);
3035
+ startVerification(externalId, tier, expectedFirstName, expectedLastName);
3036
+ }, [externalId, tier, expectedFirstName, expectedLastName, startVerification]);
3030
3037
  useEffect8(() => {
3031
3038
  if (state.error && onError) {
3032
3039
  onError(state.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koraidv/react",
3
- "version": "1.7.10",
3
+ "version": "1.7.11",
4
4
  "description": "Kora IDV React Components for Identity Verification",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -21,7 +21,7 @@
21
21
  "test": "vitest run"
22
22
  },
23
23
  "dependencies": {
24
- "@koraidv/core": "^1.7.10"
24
+ "@koraidv/core": "^1.7.11"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "^18.2.0",