@mosip/react-inji-verify-sdk 0.16.0-beta.3 → 0.16.0-beta.5
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/Readme.md
CHANGED
|
@@ -31,6 +31,7 @@ function MyApp() {
|
|
|
31
31
|
console.log("Something went wrong:", error);
|
|
32
32
|
}}
|
|
33
33
|
triggerElement={<button>📷 Scan ID Document</button>}
|
|
34
|
+
clientId="CLIENT_ID"
|
|
34
35
|
/>
|
|
35
36
|
);
|
|
36
37
|
}
|
|
@@ -50,6 +51,7 @@ function MyApp() {
|
|
|
50
51
|
onQrCodeExpired={() => alert("QR code expired, please try again")}
|
|
51
52
|
onError={(error) => console.log("Error:", error)}
|
|
52
53
|
triggerElement={<button>📱 Verify with Digital Wallet</button>}
|
|
54
|
+
clientId="CLIENT_ID"
|
|
53
55
|
/>
|
|
54
56
|
);
|
|
55
57
|
}
|
|
@@ -106,6 +108,7 @@ https://your-backend.com
|
|
|
106
108
|
onVCProcessed={(result) => handleResult(result)}
|
|
107
109
|
onError={(error) => handleError(error)}
|
|
108
110
|
triggerElement={<button>Start Verification</button>}
|
|
111
|
+
clientId="CLIENT_ID"
|
|
109
112
|
/>
|
|
110
113
|
```
|
|
111
114
|
|
|
@@ -116,6 +119,7 @@ https://your-backend.com
|
|
|
116
119
|
verifyServiceUrl="https://your-backend.com"
|
|
117
120
|
onVCProcessed={(result) => console.log(result)} // OR use onVCReceived
|
|
118
121
|
onError={(error) => console.log(error)}
|
|
122
|
+
clientId="CLIENT_ID"
|
|
119
123
|
|
|
120
124
|
// Optional
|
|
121
125
|
triggerElement={<button>Custom Trigger</button>}
|
|
@@ -144,6 +148,7 @@ https://your-backend.com
|
|
|
144
148
|
onVpProcessed={(result) => handleResult(result)}
|
|
145
149
|
onQrCodeExpired={() => alert("Please try again")}
|
|
146
150
|
onError={(error) => handleError(error)}
|
|
151
|
+
clientId="CLIENT_ID"
|
|
147
152
|
/>
|
|
148
153
|
```
|
|
149
154
|
|
|
@@ -156,6 +161,7 @@ https://your-backend.com
|
|
|
156
161
|
onQrCodeExpired={() => alert("QR expired")}
|
|
157
162
|
onError={(error) => console.error(error)}
|
|
158
163
|
triggerElement={<button>🔐 Verify Credentials</button>}
|
|
164
|
+
clientId="CLIENT_ID"
|
|
159
165
|
/>
|
|
160
166
|
```
|
|
161
167
|
|
|
@@ -205,6 +211,7 @@ presentationDefinition={{
|
|
|
205
211
|
| `onError` | function | ✅ | What to do when something goes wrong |
|
|
206
212
|
| `triggerElement` | React element | ❌ | Custom button/element to start verification |
|
|
207
213
|
| `transactionId` | string | ❌ | Your own tracking ID |
|
|
214
|
+
| `clientId` | string | ✅ | Your own client ID |
|
|
208
215
|
|
|
209
216
|
### QRCodeVerification Specific
|
|
210
217
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { QRCodeVerificationProps } from "
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { QRCodeVerificationProps } from "./QRCodeVerification.types";
|
|
3
3
|
import "./QRCodeVerification.css";
|
|
4
4
|
declare const QRCodeVerification: React.FC<QRCodeVerificationProps>;
|
|
5
5
|
export default QRCodeVerification;
|
|
@@ -56,8 +56,21 @@ export type QRCodeVerificationProps = ExclusiveCallbacks & {
|
|
|
56
56
|
* Defaults to true.
|
|
57
57
|
*/
|
|
58
58
|
isEnableScan?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Callback invoked when the scanner is closed.
|
|
61
|
+
* Can be used to redirect to home or perform cleanup.
|
|
62
|
+
*/
|
|
59
63
|
onClose?: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Enable scan functionality.
|
|
66
|
+
* Defaults to true.
|
|
67
|
+
*/
|
|
60
68
|
scannerActive?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* A unique identifier for the client application.
|
|
71
|
+
* Used in the OVP redirect flow.
|
|
72
|
+
*/
|
|
73
|
+
clientId: string;
|
|
61
74
|
};
|
|
62
75
|
interface VerificationResult {
|
|
63
76
|
/**
|