@koraidv/react 1.7.8 → 1.7.9
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -9
- package/dist/index.mjs +4 -9
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -87,7 +87,7 @@ interface UseKoraIDVReturn {
|
|
|
87
87
|
/**
|
|
88
88
|
* Upload document image
|
|
89
89
|
*/
|
|
90
|
-
uploadDocument: (imageData: Blob, side: 'front' | 'back') => Promise<boolean>;
|
|
90
|
+
uploadDocument: (imageData: Blob, side: 'front' | 'back', country?: string) => Promise<boolean>;
|
|
91
91
|
/**
|
|
92
92
|
* Upload selfie image
|
|
93
93
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ interface UseKoraIDVReturn {
|
|
|
87
87
|
/**
|
|
88
88
|
* Upload document image
|
|
89
89
|
*/
|
|
90
|
-
uploadDocument: (imageData: Blob, side: 'front' | 'back') => Promise<boolean>;
|
|
90
|
+
uploadDocument: (imageData: Blob, side: 'front' | 'back', country?: string) => Promise<boolean>;
|
|
91
91
|
/**
|
|
92
92
|
* Upload selfie image
|
|
93
93
|
*/
|
package/dist/index.js
CHANGED
|
@@ -191,11 +191,11 @@ function useKoraIDV() {
|
|
|
191
191
|
[sdk, selectedDocumentType]
|
|
192
192
|
);
|
|
193
193
|
const uploadDocument = (0, import_react2.useCallback)(
|
|
194
|
-
async (imageData, side) => {
|
|
194
|
+
async (imageData, side, country) => {
|
|
195
195
|
if (!selectedDocumentType) return false;
|
|
196
196
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
197
197
|
try {
|
|
198
|
-
const result = await sdk.uploadDocument(imageData, side, selectedDocumentType);
|
|
198
|
+
const result = await sdk.uploadDocument(imageData, side, selectedDocumentType, country);
|
|
199
199
|
if (result.success) {
|
|
200
200
|
if (side === "front") {
|
|
201
201
|
setDocumentFrontCaptured(true);
|
|
@@ -3065,11 +3065,6 @@ function VerificationFlow({
|
|
|
3065
3065
|
(0, import_react10.useEffect)(() => {
|
|
3066
3066
|
startVerification(externalId, tier);
|
|
3067
3067
|
}, [externalId, tier, startVerification]);
|
|
3068
|
-
(0, import_react10.useEffect)(() => {
|
|
3069
|
-
if (state.step === "complete" && state.verification && onComplete) {
|
|
3070
|
-
onComplete(state.verification);
|
|
3071
|
-
}
|
|
3072
|
-
}, [state.step, state.verification, onComplete]);
|
|
3073
3068
|
(0, import_react10.useEffect)(() => {
|
|
3074
3069
|
if (state.error && onError) {
|
|
3075
3070
|
onError(state.error);
|
|
@@ -3152,7 +3147,7 @@ function VerificationFlow({
|
|
|
3152
3147
|
{
|
|
3153
3148
|
side: "front",
|
|
3154
3149
|
onQualityCheck: (blob) => checkDocumentQuality(blob),
|
|
3155
|
-
onCapture: (imageData) => uploadDocument(imageData, "front"),
|
|
3150
|
+
onCapture: (imageData) => uploadDocument(imageData, "front", selectedCountry?.id),
|
|
3156
3151
|
onCancel: handleCancel
|
|
3157
3152
|
}
|
|
3158
3153
|
),
|
|
@@ -3167,7 +3162,7 @@ function VerificationFlow({
|
|
|
3167
3162
|
DocumentCaptureScreen,
|
|
3168
3163
|
{
|
|
3169
3164
|
side: "back",
|
|
3170
|
-
onCapture: (imageData) => uploadDocument(imageData, "back"),
|
|
3165
|
+
onCapture: (imageData) => uploadDocument(imageData, "back", selectedCountry?.id),
|
|
3171
3166
|
onCancel: handleCancel
|
|
3172
3167
|
}
|
|
3173
3168
|
),
|
package/dist/index.mjs
CHANGED
|
@@ -142,11 +142,11 @@ function useKoraIDV() {
|
|
|
142
142
|
[sdk, selectedDocumentType]
|
|
143
143
|
);
|
|
144
144
|
const uploadDocument = useCallback(
|
|
145
|
-
async (imageData, side) => {
|
|
145
|
+
async (imageData, side, country) => {
|
|
146
146
|
if (!selectedDocumentType) return false;
|
|
147
147
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
148
148
|
try {
|
|
149
|
-
const result = await sdk.uploadDocument(imageData, side, selectedDocumentType);
|
|
149
|
+
const result = await sdk.uploadDocument(imageData, side, selectedDocumentType, country);
|
|
150
150
|
if (result.success) {
|
|
151
151
|
if (side === "front") {
|
|
152
152
|
setDocumentFrontCaptured(true);
|
|
@@ -3016,11 +3016,6 @@ function VerificationFlow({
|
|
|
3016
3016
|
useEffect8(() => {
|
|
3017
3017
|
startVerification(externalId, tier);
|
|
3018
3018
|
}, [externalId, tier, startVerification]);
|
|
3019
|
-
useEffect8(() => {
|
|
3020
|
-
if (state.step === "complete" && state.verification && onComplete) {
|
|
3021
|
-
onComplete(state.verification);
|
|
3022
|
-
}
|
|
3023
|
-
}, [state.step, state.verification, onComplete]);
|
|
3024
3019
|
useEffect8(() => {
|
|
3025
3020
|
if (state.error && onError) {
|
|
3026
3021
|
onError(state.error);
|
|
@@ -3103,7 +3098,7 @@ function VerificationFlow({
|
|
|
3103
3098
|
{
|
|
3104
3099
|
side: "front",
|
|
3105
3100
|
onQualityCheck: (blob) => checkDocumentQuality(blob),
|
|
3106
|
-
onCapture: (imageData) => uploadDocument(imageData, "front"),
|
|
3101
|
+
onCapture: (imageData) => uploadDocument(imageData, "front", selectedCountry?.id),
|
|
3107
3102
|
onCancel: handleCancel
|
|
3108
3103
|
}
|
|
3109
3104
|
),
|
|
@@ -3118,7 +3113,7 @@ function VerificationFlow({
|
|
|
3118
3113
|
DocumentCaptureScreen,
|
|
3119
3114
|
{
|
|
3120
3115
|
side: "back",
|
|
3121
|
-
onCapture: (imageData) => uploadDocument(imageData, "back"),
|
|
3116
|
+
onCapture: (imageData) => uploadDocument(imageData, "back", selectedCountry?.id),
|
|
3122
3117
|
onCancel: handleCancel
|
|
3123
3118
|
}
|
|
3124
3119
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koraidv/react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
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.
|
|
24
|
+
"@koraidv/core": "^1.7.9"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/react": "^18.2.0",
|