@injistack/react-inji-verify-sdk 0.18.0-beta.20 → 0.18.0-beta.22

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
@@ -65,20 +65,63 @@ function MyApp() {
65
65
 
66
66
  ## Response Received
67
67
 
68
- When verification is completed, the response received is as below:
68
+ When verification is completed, the response received is based on summariseResults attribute which will decide the format of the response from SDK.
69
69
 
70
+ ### QRCodeVerification
71
+
72
+ If summariseResults=true, then response should be
70
73
  ```javascript
71
74
  {
72
- vcResults: [
73
- {
74
- vc: { /* Your verified credential data */ },
75
- vcStatus: "SUCCESS" // or "INVALID", "EXPIRED"
76
- }
77
- ],
78
- vpResultStatus: "SUCCESS" // Overall verification status
75
+ "verificationStatus":"STATUS"
79
76
  }
80
77
  ```
81
-
78
+ If summariseResults=false, then response should be
79
+ ```javascript
80
+ {
81
+ "allChecksSuccessful": true,
82
+ "schemaAndSignatureCheck": { "valid": true, "error": null },
83
+ "expiryCheck": { "valid": true },
84
+ "statusChecks": [
85
+ { "purpose": "revocation", "valid": true, "error": null },
86
+ { "purpose": "suspension", "valid": true, "error": null }
87
+ ],
88
+ "claims": {...}
89
+ }
90
+ ```
91
+ ### OpenID4VPVerification
92
+ If summariseResults=true, then response should be
93
+ ```javascript
94
+ {
95
+ vcResults: [
96
+ {
97
+ vc: { /* Your verified credential data */ },
98
+ vcStatus: "SUCCESS" // or "INVALID", "EXPIRED"
99
+ }
100
+ ],
101
+ vpResultStatus: "SUCCESS" // Overall verification status
102
+ }
103
+ ```
104
+ If summariseResults=false, then response should be
105
+ ```javascript
106
+ {
107
+ "transactionId": "txn_11",
108
+ "allChecksSuccessful": true,
109
+ "credentialResults": [
110
+ {
111
+ "verifiableCredential": "{...}",
112
+ "allChecksSuccessful": true,
113
+ "holderProofCheck": { "valid": true, "error": null },
114
+ "schemaAndSignatureCheck": { "valid": true, "error": null },
115
+ "expiryCheck": { "valid": true },
116
+ "statusChecks": [
117
+ { "purpose": "revocation", "valid": true, "error": null },
118
+ { "purpose": "suspension", "valid": true, "error": null },
119
+ ],
120
+ "claims": {..}
121
+ }
122
+ ]
123
+ }
124
+ ```
82
125
  > **Security Recommendation**
83
126
  >
84
127
  > Avoid consuming results directly from VPProcessed or VCProcessed.
@@ -143,6 +186,7 @@ https://your-backend.com
143
186
  isEnableZoom={true} // Allow camera zoom
144
187
  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.
145
188
  acceptVPWithoutHolderProof={false} // This attribute controls whether unsigned Verifiable Presentations (VPs without proof) are allowed in the Inji OVP VC sharing flow. By default, it is set to false, meaning unsigned VP tokens are not supported and an error is thrown if an unsigned VP is received. If set to true, VP tokens without a signature (proof) are allowed and can be verified. For data-share it is set to true by default.
189
+ summariseResults={true} // This attribute will decide the format of the response from SDK
146
190
  />
147
191
  ```
148
192
 
@@ -225,13 +269,14 @@ presentationDefinition={{
225
269
  ### Common Props (Both Components)
226
270
 
227
271
  | Property | Type | Required | Description |
228
- | ---------------------------- | ------------- | -------- | ------------------------------------------- |
229
- | `verifyServiceUrl` | string | ✅ | Backend verification URL |
230
- | `onError` | function | ✅ | Callback invoked when an error occurs |
231
- | `triggerElement` | React element | ❌ | Custom button/element to start verification |
232
- | `transactionId` | string | ❌ | Optional client-side tracking ID |
233
- | `clientId` | string | ✅ | Client identifier |
234
- | `acceptVPWithoutHolderProof` | boolean | ❌ | Allow unsigned Verifiable Presentations |
272
+ |------------------------------|---------------| ----- |---------------------------------------------|
273
+ | `verifyServiceUrl` | string | ✅ | Backend verification URL |
274
+ | `onError` | function | ✅ | Callback invoked when an error occurs |
275
+ | `triggerElement` | React element | ❌ | Custom button/element to start verification |
276
+ | `transactionId` | string | ❌ | Optional client-side tracking ID |
277
+ | `clientId` | string | ✅ | Client identifier |
278
+ | `acceptVPWithoutHolderProof` | boolean | ❌ | Allow unsigned Verifiable Presentations |
279
+ | `summariseResults` | boolean | ❌ | Decides format of SDK Response |
235
280
 
236
281
  ### QRCodeVerification Specific
237
282
 
@@ -90,6 +90,7 @@ export type QRCodeVerificationProps = ExclusiveCallbacks & {
90
90
  * - Status checks (e.g., revocation)
91
91
  */
92
92
  vcVerificationV2Request?: VCVerificationV2Request;
93
+ summariseResults?: boolean;
93
94
  };
94
95
  export type VcStatus = "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
95
96
  export type scanResult = {
@@ -116,9 +117,12 @@ export interface VCVerificationV2Response {
116
117
  statusCheck: ValidationCheck[];
117
118
  claims?: Record<string, any>;
118
119
  }
120
+ export interface VCSummarisedVerificationResponse {
121
+ verificationStatus: "SUCCESS" | "INVALID" | "EXPIRED" | "REVOKED";
122
+ }
119
123
  export type VerificationResults = {
120
124
  vc: any;
121
- verificationResponse: VCVerificationV2Response;
125
+ verificationResponse: VCVerificationV2Response | VCSummarisedVerificationResponse;
122
126
  }[];
123
127
  export interface vcSubmissionBody {
124
128
  vc: any;