@mosip/react-inji-verify-sdk 0.15.0-beta.8 → 0.15.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/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>}
@@ -205,6 +209,7 @@ presentationDefinition={{
205
209
  | `onError` | function | ✅ | What to do when something goes wrong |
206
210
  | `triggerElement` | React element | ❌ | Custom button/element to start verification |
207
211
  | `transactionId` | string | ❌ | Your own tracking ID |
212
+ | `clientId` | string | ✅ | Your own client ID |
208
213
 
209
214
  ### QRCodeVerification Specific
210
215
 
@@ -227,7 +232,7 @@ presentationDefinition={{
227
232
  | `onVpProcessed` | function | - | Get full results immediately |
228
233
  | `onVpReceived` | function | - | Get transaction ID only |
229
234
  | `onQrCodeExpired` | function | - | Handle QR code expiration |
230
- | `isEnableSameDeviceFlow` | boolean | true | Enable same-device flow (optional) |
235
+ | `isSameDeviceFlowEnabled` | boolean | true | Enable same-device flow (optional) |
231
236
  | `qrCodeStyles` | object | - | Customize QR code appearance |
232
237
 
233
238
  ## ⚠️ Important Limitations
@@ -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;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- export type OpenID4VPError = {
3
- message: string;
4
- code?: string;
5
- details?: unknown;
6
- };
7
2
  export type VerificationStatus = "valid" | "invalid" | "expired";
8
3
  export interface VerificationResult {
9
4
  /**
@@ -23,6 +18,7 @@ export interface QrData {
23
18
  requestId: string;
24
19
  authorizationDetails?: {
25
20
  responseType: string;
21
+ responseMode: string;
26
22
  clientId: string;
27
23
  presentationDefinition: Record<string, unknown>;
28
24
  presentationDefinitionUri?: string;
@@ -125,7 +121,7 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
125
121
  Indicates whether the same device flow is enabled.
126
122
  Defaults to true, allowing verification on the same device.
127
123
  */
128
- isEnableSameDeviceFlow?: boolean;
124
+ isSameDeviceFlowEnabled?: boolean;
129
125
  /**
130
126
 
131
127
  Styling options for the QR code.
@@ -148,6 +144,10 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
148
144
  */
149
145
  onError: (error: AppError) => void;
150
146
  };
147
+ export interface SessionState {
148
+ requestId: string;
149
+ transactionId: string;
150
+ }
151
151
  export type AppError = {
152
152
  errorMessage: string;
153
153
  errorCode?: string;
@@ -58,6 +58,7 @@ export type QRCodeVerificationProps = ExclusiveCallbacks & {
58
58
  isEnableScan?: boolean;
59
59
  onClose?: () => void;
60
60
  scannerActive?: boolean;
61
+ clientId: string;
61
62
  };
62
63
  interface VerificationResult {
63
64
  /**