@mosip/react-inji-verify-sdk 0.16.0-beta.1 → 0.16.0-beta.10

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>}
@@ -125,6 +129,7 @@ https://your-backend.com
125
129
  isEnableUpload={true} // Allow file uploads
126
130
  isEnableScan={true} // Allow camera scanning
127
131
  isEnableZoom={true} // Allow camera zoom
132
+ isVPSubmissionSupported={false} // This attribute indicates whether VP submission is supported in Inji OVP VC sharing flow. By default, it is false which means that VP token will be directly sent in response. If set to true, then VP token will be submitted to the VP_SUBMISSION_ URL.
128
133
  />
129
134
  ```
130
135
 
@@ -144,6 +149,7 @@ https://your-backend.com
144
149
  onVpProcessed={(result) => handleResult(result)}
145
150
  onQrCodeExpired={() => alert("Please try again")}
146
151
  onError={(error) => handleError(error)}
152
+ clientId="CLIENT_ID"
147
153
  />
148
154
  ```
149
155
 
@@ -156,6 +162,7 @@ https://your-backend.com
156
162
  onQrCodeExpired={() => alert("QR expired")}
157
163
  onError={(error) => console.error(error)}
158
164
  triggerElement={<button>🔐 Verify Credentials</button>}
165
+ clientId="CLIENT_ID"
159
166
  />
160
167
  ```
161
168
 
@@ -205,17 +212,19 @@ presentationDefinition={{
205
212
  | `onError` | function | ✅ | What to do when something goes wrong |
206
213
  | `triggerElement` | React element | ❌ | Custom button/element to start verification |
207
214
  | `transactionId` | string | ❌ | Your own tracking ID |
215
+ | `clientId` | string | ✅ | Your own client ID |
208
216
 
209
217
  ### QRCodeVerification Specific
210
218
 
211
- | Property | Type | Default | Description |
212
- |---------------------|----------|---------|------------------------------|
213
- | `onVCProcessed` | function | - | Get full results immediately |
214
- | `onVCReceived` | function | - | Get transaction ID only |
215
- | `isEnableUpload` | boolean | true | Allow file uploads |
216
- | `isEnableScan` | boolean | true | Allow camera scanning |
217
- | `isEnableZoom` | boolean | true | Allow camera zoom |
218
- | `uploadButtonStyle` | object | - | Custom upload button styling |
219
+ | Property | Type | Default | Description |
220
+ |---------------------------|----------|---------|------------------------------|
221
+ | `onVCProcessed` | function | - | Get full results immediately |
222
+ | `onVCReceived` | function | - | Get transaction ID only |
223
+ | `isEnableUpload` | boolean | true | Allow file uploads |
224
+ | `isEnableScan` | boolean | true | Allow camera scanning |
225
+ | `isEnableZoom` | boolean | true | Allow camera zoom |
226
+ | `uploadButtonStyle` | object | - | Custom upload button styling |
227
+ | `isVPSubmissionSupported` | Boolean | false | Toggle VP submission support |
219
228
 
220
229
  ### OpenID4VPVerification Specific
221
230
 
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { OpenID4VPVerificationProps } from "./OpenID4VPVerification.types";
3
3
  import "./OpenID4VPVerification.css";
4
+ export declare const isMobileDevice: () => boolean;
4
5
  declare const OpenID4VPVerification: React.FC<OpenID4VPVerificationProps>;
5
6
  export default OpenID4VPVerification;
@@ -144,6 +144,10 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
144
144
  */
145
145
  onError: (error: AppError) => void;
146
146
  };
147
+ export interface SessionState {
148
+ requestId: string;
149
+ transactionId: string;
150
+ }
147
151
  export type AppError = {
148
152
  errorMessage: string;
149
153
  errorCode?: string;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { QRCodeVerificationProps } from "../../components/qrcode-verification/QRCodeVerification.types";
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,26 @@ 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;
74
+ /**
75
+ * Enable Data share VP Supported functionality.
76
+ * Defaults to false.
77
+ */
78
+ isVPSubmissionSupported?: boolean;
61
79
  };
62
80
  interface VerificationResult {
63
81
  /**
@@ -79,4 +97,20 @@ export interface vcSubmissionBody {
79
97
  vc: any;
80
98
  transactionId?: string;
81
99
  }
100
+ export interface QrData {
101
+ transactionId: string;
102
+ requestId: string;
103
+ authorizationDetails?: {
104
+ responseType: string;
105
+ responseMode: string;
106
+ clientId: string;
107
+ presentationDefinition: Record<string, unknown>;
108
+ presentationDefinitionUri?: string;
109
+ responseUri: string;
110
+ nonce: string;
111
+ iat: number;
112
+ };
113
+ expiresAt: number;
114
+ requestUri?: string;
115
+ }
82
116
  export {};