@injistack/react-inji-verify-sdk 0.17.0-beta.12
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 +247 -0
- package/dist/components/openid4vp-verification/OpenID4VPVerification.d.ts +6 -0
- package/dist/components/openid4vp-verification/OpenID4VPVerification.types.d.ts +139 -0
- package/dist/components/qrcode-verification/QRCodeVerification.d.ts +5 -0
- package/dist/components/qrcode-verification/QRCodeVerification.types.d.ts +105 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +41 -0
- package/dist/types/OVPSchemeQrData.d.ts +16 -0
- package/dist/utils/api.d.ts +7 -0
- package/dist/utils/constants.d.ts +20 -0
- package/dist/utils/dataProcessor.d.ts +2 -0
- package/dist/utils/themeUtils.d.ts +4 -0
- package/dist/utils/uploadQRCodeUtils.d.ts +5 -0
- package/dist/utils/utils.d.ts +1 -0
- package/package.json +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# INJI VERIFY SDK
|
|
2
|
+
|
|
3
|
+
Inji Verify SDK provides ready-to-use **React components** to integrate [OpenID4VP](https://openid.net/specs/openid-4-verifiable-presentations-1_0.html)-based **Verifiable Credential (VC) and Verifiable Presentation (VP) verification** into any React TypeScript web application.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Usage Guide
|
|
7
|
+
|
|
8
|
+
### Step 1: Install the Package
|
|
9
|
+
```bash
|
|
10
|
+
npm i @injistack/react-inji-verify-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Step 2: Import and Use
|
|
14
|
+
```javascript
|
|
15
|
+
import { OpenID4VPVerification, QRCodeVerification } from "@injistack/react-inji-verify-sdk";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Step 3: Choose Your Verification Method
|
|
19
|
+
|
|
20
|
+
**Option A: QR Code Verification (Scan & Upload)**
|
|
21
|
+
```javascript
|
|
22
|
+
function MyApp() {
|
|
23
|
+
return (
|
|
24
|
+
<QRCodeVerification
|
|
25
|
+
verifyServiceUrl="https://your-backend.com/verify"
|
|
26
|
+
onVCProcessed={(result) => {
|
|
27
|
+
console.log("Verification complete:", result);
|
|
28
|
+
// Handle the verification result here
|
|
29
|
+
}}
|
|
30
|
+
onError={(error) => {
|
|
31
|
+
console.log("Something went wrong:", error);
|
|
32
|
+
}}
|
|
33
|
+
triggerElement={<button>📷 Scan ID Document</button>}
|
|
34
|
+
clientId="CLIENT_ID"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Option B: OpenID4VP Verification**
|
|
41
|
+
```javascript
|
|
42
|
+
function MyApp() {
|
|
43
|
+
return (
|
|
44
|
+
<OpenID4VPVerification
|
|
45
|
+
verifyServiceUrl="https://your-backend.com/v1/verify"
|
|
46
|
+
presentationDefinitionId="your-definition-id"
|
|
47
|
+
onVpProcessed={(result) => {
|
|
48
|
+
console.log("Wallet verification complete:", result);
|
|
49
|
+
// Handle the verification result here
|
|
50
|
+
}}
|
|
51
|
+
onQrCodeExpired={() => alert("QR code expired, please try again")}
|
|
52
|
+
onError={(error) => console.log("Error:", error)}
|
|
53
|
+
triggerElement={<button>📱 Verify with Digital Wallet</button>}
|
|
54
|
+
clientId="CLIENT_ID"
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Response Received
|
|
61
|
+
|
|
62
|
+
When verification is completed, the response received is as below:
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
{
|
|
66
|
+
vcResults: [
|
|
67
|
+
{
|
|
68
|
+
vc: { /* Your verified credential data */ },
|
|
69
|
+
vcStatus: "SUCCESS" // or "INVALID", "EXPIRED"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
vpResultStatus: "SUCCESS" // Overall verification status
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
>**Security Recommendation**
|
|
76
|
+
>
|
|
77
|
+
>Avoid consuming results directly from VPProcessed or VCProcessed.
|
|
78
|
+
Instead, use VPReceived or VCReceived events to capture the txnId, then retrieve the verification results securely from your backend's verification service endpoint.
|
|
79
|
+
This ensures data integrity and prevents reliance on client-side verification data for final decisions.
|
|
80
|
+
|
|
81
|
+
## Pre-requisites
|
|
82
|
+
|
|
83
|
+
### What You Need:
|
|
84
|
+
1. **A React project** (TypeScript recommended)
|
|
85
|
+
2. **A verification backend** - You need a server that can verify credentials
|
|
86
|
+
3. **Camera permissions** - For QR scanning features
|
|
87
|
+
|
|
88
|
+
### Backend Requirements:
|
|
89
|
+
Your backend must support the OpenID4VP protocol. You can either:
|
|
90
|
+
- Use the official `inji-verify-service`
|
|
91
|
+
- Build your own following [this specification](https://openid.net/specs/openid-4-verifiable-presentations-1_0-ID3.html)
|
|
92
|
+
|
|
93
|
+
**Important:** Your backend URL should look like:
|
|
94
|
+
```
|
|
95
|
+
https://your-backend.com
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 📖 Detailed Component Guide
|
|
99
|
+
|
|
100
|
+
### QRCodeVerification Component
|
|
101
|
+
|
|
102
|
+
**Perfect for:** Scanning QR codes from documents or uploading QR codes (PNG, JPEG, JPG, PDF)
|
|
103
|
+
|
|
104
|
+
#### Basic Setup:
|
|
105
|
+
```javascript
|
|
106
|
+
<QRCodeVerification
|
|
107
|
+
verifyServiceUrl="https://your-backend.com"
|
|
108
|
+
onVCProcessed={(result) => handleResult(result)}
|
|
109
|
+
onError={(error) => handleError(error)}
|
|
110
|
+
triggerElement={<button>Start Verification</button>}
|
|
111
|
+
clientId="CLIENT_ID"
|
|
112
|
+
/>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### All Available Options:
|
|
116
|
+
```javascript
|
|
117
|
+
<QRCodeVerification
|
|
118
|
+
// Required
|
|
119
|
+
verifyServiceUrl="https://your-backend.com"
|
|
120
|
+
onVCProcessed={(result) => console.log(result)} // OR use onVCReceived
|
|
121
|
+
onError={(error) => console.log(error)}
|
|
122
|
+
clientId="CLIENT_ID"
|
|
123
|
+
|
|
124
|
+
// Optional
|
|
125
|
+
triggerElement={<button>Custom Trigger</button>}
|
|
126
|
+
transactionId="your-tracking-id" //Optional
|
|
127
|
+
uploadButtonId="my-upload-btn"
|
|
128
|
+
uploadButtonStyle={{ backgroundColor: 'blue' }}
|
|
129
|
+
isEnableUpload={true} // Allow file uploads
|
|
130
|
+
isEnableScan={true} // Allow camera scanning
|
|
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.
|
|
133
|
+
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.
|
|
134
|
+
/>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Choose One Callback:**
|
|
138
|
+
- `onVCProcessed`: Get full verification results immediately
|
|
139
|
+
- `onVCReceived`: Get just a transaction ID (your backend handles the rest)
|
|
140
|
+
|
|
141
|
+
### OpenID4VPVerification Component
|
|
142
|
+
|
|
143
|
+
**Perfect for:** Integrating with digital wallets (like mobile ID apps)
|
|
144
|
+
|
|
145
|
+
#### Basic Setup:
|
|
146
|
+
```javascript
|
|
147
|
+
<OpenID4VPVerification
|
|
148
|
+
verifyServiceUrl="https://your-backend.com"
|
|
149
|
+
presentationDefinitionId="what-you-want-to-verify"
|
|
150
|
+
onVpProcessed={(result) => handleResult(result)}
|
|
151
|
+
onQrCodeExpired={() => alert("Please try again")}
|
|
152
|
+
onError={(error) => handleError(error)}
|
|
153
|
+
clientId="CLIENT_ID"
|
|
154
|
+
/>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### With Presentation Definition:
|
|
158
|
+
```javascript
|
|
159
|
+
<OpenID4VPVerification
|
|
160
|
+
verifyServiceUrl="https://your-backend.com"
|
|
161
|
+
presentationDefinition={"Refer Option 2 below"}
|
|
162
|
+
onVpProcessed={(result) => console.log(result)}
|
|
163
|
+
onQrCodeExpired={() => alert("QR expired")}
|
|
164
|
+
onError={(error) => console.error(error)}
|
|
165
|
+
triggerElement={<button>🔐 Verify Credentials</button>}
|
|
166
|
+
clientId="CLIENT_ID"
|
|
167
|
+
/>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Define What to Verify:
|
|
171
|
+
|
|
172
|
+
**Option 1: Use a predefined template**
|
|
173
|
+
```javascript
|
|
174
|
+
presentationDefinitionId="drivers-license-check"
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Option 2: Define exactly what you want**
|
|
178
|
+
```javascript
|
|
179
|
+
presentationDefinition={{
|
|
180
|
+
id: "custom-verification",
|
|
181
|
+
purpose: "We need to verify your identity",
|
|
182
|
+
format: {
|
|
183
|
+
ldp_vc: {
|
|
184
|
+
proof_type: ["Ed25519Signature2020"],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
input_descriptors: [
|
|
188
|
+
{
|
|
189
|
+
id: "id-card-check",
|
|
190
|
+
constraints: {
|
|
191
|
+
fields: [
|
|
192
|
+
{
|
|
193
|
+
path: ["$.type"],
|
|
194
|
+
filter: {
|
|
195
|
+
type: "object",
|
|
196
|
+
pattern: "DriverLicenseCredential",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
}}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## 🎛️ Component Options Reference
|
|
207
|
+
|
|
208
|
+
### Common Props (Both Components)
|
|
209
|
+
|
|
210
|
+
| Property | Type | Required | Description |
|
|
211
|
+
|----------------------------------|---------------|----------|---------------------------------------------|
|
|
212
|
+
| `verifyServiceUrl` | string | ✅ | Backend verification URL |
|
|
213
|
+
| `onError` | function | ✅ | Callback invoked when an error occurs |
|
|
214
|
+
| `triggerElement` | React element | ❌ | Custom button/element to start verification |
|
|
215
|
+
| `transactionId` | string | ❌ | Optional client-side tracking ID |
|
|
216
|
+
| `clientId` | string | ✅ | Client identifier |
|
|
217
|
+
| `acceptVPWithoutHolderProof` | boolean | ❌ | Allow unsigned Verifiable Presentations |
|
|
218
|
+
|
|
219
|
+
### QRCodeVerification Specific
|
|
220
|
+
|
|
221
|
+
| Property | Type | Default | Description |
|
|
222
|
+
|---------------------------|----------|---------|------------------------------|
|
|
223
|
+
| `onVCProcessed` | function | - | Get full results immediately |
|
|
224
|
+
| `onVCReceived` | function | - | Get transaction ID only |
|
|
225
|
+
| `isEnableUpload` | boolean | true | Allow file uploads |
|
|
226
|
+
| `isEnableScan` | boolean | true | Allow camera scanning |
|
|
227
|
+
| `isEnableZoom` | boolean | true | Allow camera zoom |
|
|
228
|
+
| `uploadButtonStyle` | object | - | Custom upload button styling |
|
|
229
|
+
| `isVPSubmissionSupported` | Boolean | false | Toggle VP submission support |
|
|
230
|
+
|
|
231
|
+
### OpenID4VPVerification Specific
|
|
232
|
+
|
|
233
|
+
| Property | Type | Default | Description |
|
|
234
|
+
|----------------------------|----------|----------------|------------------------------------|
|
|
235
|
+
| `protocol` | string | "openid4vp://" | Protocol for QR codes (optional) |
|
|
236
|
+
| `presentationDefinitionId` | string | - | Predefined verification template |
|
|
237
|
+
| `presentationDefinition` | object | - | Custom verification rules |
|
|
238
|
+
| `onVpProcessed` | function | - | Get full results immediately |
|
|
239
|
+
| `onVpReceived` | function | - | Get transaction ID only |
|
|
240
|
+
| `onQrCodeExpired` | function | - | Handle QR code expiration |
|
|
241
|
+
| `isSameDeviceFlowEnabled` | boolean | true | Enable same-device flow (optional) |
|
|
242
|
+
| `qrCodeStyles` | object | - | Customize QR code appearance |
|
|
243
|
+
|
|
244
|
+
## ⚠️ Important Limitations
|
|
245
|
+
|
|
246
|
+
- **React Only:** Won't work with Angular, Vue, or React Native
|
|
247
|
+
- **Backend Required:** You must have a verification service running
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OpenID4VPVerificationProps } from "./OpenID4VPVerification.types";
|
|
3
|
+
import "./OpenID4VPVerification.css";
|
|
4
|
+
export declare const isMobileDevice: () => boolean;
|
|
5
|
+
declare const OpenID4VPVerification: React.FC<OpenID4VPVerificationProps>;
|
|
6
|
+
export default OpenID4VPVerification;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type VerificationStatus = "valid" | "invalid" | "expired";
|
|
3
|
+
export interface VerificationResult {
|
|
4
|
+
/**
|
|
5
|
+
|
|
6
|
+
Verified credential data (structured per implementation).
|
|
7
|
+
*/
|
|
8
|
+
vc: Record<string, unknown>;
|
|
9
|
+
/**
|
|
10
|
+
|
|
11
|
+
The status of the verification.
|
|
12
|
+
*/
|
|
13
|
+
vcStatus: VerificationStatus;
|
|
14
|
+
}
|
|
15
|
+
export type VerificationResults = VerificationResult[];
|
|
16
|
+
export interface VPRequestBody {
|
|
17
|
+
clientId: string;
|
|
18
|
+
nonce: string;
|
|
19
|
+
transactionId?: string;
|
|
20
|
+
presentationDefinitionId?: string;
|
|
21
|
+
presentationDefinition?: PresentationDefinition;
|
|
22
|
+
acceptVPWithoutHolderProof?: boolean;
|
|
23
|
+
}
|
|
24
|
+
type ExclusivePresentationDefinition =
|
|
25
|
+
/**
|
|
26
|
+
* ID of the presentation definition used for verification.
|
|
27
|
+
* Required for some verification flows.
|
|
28
|
+
*/
|
|
29
|
+
{
|
|
30
|
+
presentationDefinitionId: string;
|
|
31
|
+
presentationDefinition?: never;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The full presentation definition JSON string.
|
|
35
|
+
* If provided, it will be used instead of fetching from the backend.
|
|
36
|
+
*/
|
|
37
|
+
| {
|
|
38
|
+
presentationDefinition?: PresentationDefinition;
|
|
39
|
+
presentationDefinitionId?: never;
|
|
40
|
+
};
|
|
41
|
+
type ExclusiveCallbacks =
|
|
42
|
+
/**
|
|
43
|
+
* Callback triggered when the verification presentation (VP) is received.
|
|
44
|
+
* Provides the associated transaction ID.
|
|
45
|
+
*/
|
|
46
|
+
{
|
|
47
|
+
onVPReceived: (transactionId: string) => void;
|
|
48
|
+
onVPProcessed?: never;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Callback triggered when the VP is successfully processed.
|
|
52
|
+
* Provides the verification result data.
|
|
53
|
+
*/
|
|
54
|
+
| {
|
|
55
|
+
onVPProcessed: (VPResult: VerificationResults) => void;
|
|
56
|
+
onVPReceived?: never;
|
|
57
|
+
};
|
|
58
|
+
interface InputDescriptor {
|
|
59
|
+
id: string;
|
|
60
|
+
format?: {
|
|
61
|
+
ldp_vc: {
|
|
62
|
+
proof_type: string[];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
constraints?: {};
|
|
66
|
+
}
|
|
67
|
+
export interface PresentationDefinition {
|
|
68
|
+
id?: string;
|
|
69
|
+
purpose: string;
|
|
70
|
+
format?: {
|
|
71
|
+
ldp_vc: {
|
|
72
|
+
proof_type: string[];
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
input_descriptors: InputDescriptor[];
|
|
76
|
+
}
|
|
77
|
+
export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & ExclusiveCallbacks & {
|
|
78
|
+
/**
|
|
79
|
+
React element that triggers the verification process (e.g., a button).
|
|
80
|
+
If not provided, the component may automatically start the process.
|
|
81
|
+
*/
|
|
82
|
+
triggerElement?: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
The backend service URL where the verification request will be sent.
|
|
85
|
+
*/
|
|
86
|
+
verifyServiceUrl: string;
|
|
87
|
+
/**
|
|
88
|
+
The client identifier for relaying party.
|
|
89
|
+
*/
|
|
90
|
+
clientId: string;
|
|
91
|
+
/**
|
|
92
|
+
The protocol being used for verification (e.g., OpenID4VP).
|
|
93
|
+
*/
|
|
94
|
+
protocol?: string;
|
|
95
|
+
/**
|
|
96
|
+
A unique identifier for the transaction.
|
|
97
|
+
*/
|
|
98
|
+
transactionId?: string;
|
|
99
|
+
/**
|
|
100
|
+
Indicates whether the same device flow is enabled.
|
|
101
|
+
Defaults to true, allowing verification on the same device.
|
|
102
|
+
*/
|
|
103
|
+
isSameDeviceFlowEnabled?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
Styling options for the QR code.
|
|
106
|
+
*/
|
|
107
|
+
qrCodeStyles?: {
|
|
108
|
+
size?: number;
|
|
109
|
+
level?: "L" | "M" | "Q" | "H";
|
|
110
|
+
bgColor?: string;
|
|
111
|
+
fgColor?: string;
|
|
112
|
+
margin?: number;
|
|
113
|
+
borderRadius?: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Callback triggered when the QR code expires before verification is completed.
|
|
117
|
+
*/
|
|
118
|
+
onQrCodeExpired: () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Callback triggered when an error occurs during the verification process.
|
|
121
|
+
* This is a required field to ensure proper error handling.
|
|
122
|
+
*/
|
|
123
|
+
onError: (error: AppError) => void;
|
|
124
|
+
/**
|
|
125
|
+
Indicates whether to accept VP submissions without holder proof.
|
|
126
|
+
When true, allows unsigned VPs (VPs without proof).
|
|
127
|
+
*/
|
|
128
|
+
acceptVPWithoutHolderProof?: boolean;
|
|
129
|
+
};
|
|
130
|
+
export interface SessionState {
|
|
131
|
+
requestId: string;
|
|
132
|
+
transactionId: string;
|
|
133
|
+
}
|
|
134
|
+
export type AppError = {
|
|
135
|
+
errorMessage: string;
|
|
136
|
+
errorCode?: string;
|
|
137
|
+
transactionId?: string | null;
|
|
138
|
+
};
|
|
139
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ExclusiveCallbacks =
|
|
3
|
+
/**
|
|
4
|
+
* Callback triggered when the verification presentation (VP) is received.
|
|
5
|
+
* Provides the associated transaction ID.
|
|
6
|
+
*/
|
|
7
|
+
{
|
|
8
|
+
onVCReceived: (txnId: string) => void;
|
|
9
|
+
onVCProcessed?: never;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Callback triggered when the VP is successfully processed.
|
|
13
|
+
* Provides the verification result data.
|
|
14
|
+
*/
|
|
15
|
+
| {
|
|
16
|
+
onVCProcessed: (vpResult: VerificationResults) => void;
|
|
17
|
+
onVCReceived?: never;
|
|
18
|
+
};
|
|
19
|
+
export type QRCodeVerificationProps = ExclusiveCallbacks & {
|
|
20
|
+
/**
|
|
21
|
+
* React element that triggers the verification process (e.g., a button).
|
|
22
|
+
* If not provided, the component may automatically start the process.
|
|
23
|
+
*/
|
|
24
|
+
triggerElement?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* The backend service URL where the verification request will be sent.
|
|
27
|
+
* This is a required field.
|
|
28
|
+
*/
|
|
29
|
+
verifyServiceUrl: string;
|
|
30
|
+
/**
|
|
31
|
+
|
|
32
|
+
* A unique identifier for the transaction.
|
|
33
|
+
*/
|
|
34
|
+
transactionId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Callback triggered when an error occurs during the verification process.
|
|
37
|
+
* This is a required field to ensure proper error handling.
|
|
38
|
+
*/
|
|
39
|
+
onError: (error: Error) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Upload button config.
|
|
42
|
+
*/
|
|
43
|
+
uploadButtonId?: string;
|
|
44
|
+
uploadButtonStyle?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Enable camera zoom (mobile).
|
|
47
|
+
*/
|
|
48
|
+
isEnableZoom?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Enable upload functionality.
|
|
51
|
+
* Defaults to true.
|
|
52
|
+
*/
|
|
53
|
+
isEnableUpload?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Enable scan functionality.
|
|
56
|
+
* Defaults to true.
|
|
57
|
+
*/
|
|
58
|
+
isEnableScan?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Callback invoked when the scanner is closed.
|
|
61
|
+
* Can be used to redirect to home or perform cleanup.
|
|
62
|
+
*/
|
|
63
|
+
onClose?: () => void;
|
|
64
|
+
/**
|
|
65
|
+
* Enable scan functionality.
|
|
66
|
+
* Defaults to true.
|
|
67
|
+
*/
|
|
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;
|
|
79
|
+
/**
|
|
80
|
+
Indicates whether to accept VP submissions without holder proof.
|
|
81
|
+
When true, allows unsigned VPs (VPs without proof).
|
|
82
|
+
*/
|
|
83
|
+
acceptVPWithoutHolderProof?: boolean;
|
|
84
|
+
};
|
|
85
|
+
interface VerificationResult {
|
|
86
|
+
/**
|
|
87
|
+
* Verified credential data (structure depends on implementation).
|
|
88
|
+
*/
|
|
89
|
+
vc: unknown;
|
|
90
|
+
/**
|
|
91
|
+
* The status of the verification (e.g., "valid", "invalid", "expired").
|
|
92
|
+
*/
|
|
93
|
+
vcStatus: VcStatus;
|
|
94
|
+
}
|
|
95
|
+
export type VerificationResults = VerificationResult[];
|
|
96
|
+
export type VcStatus = "SUCCESS" | "INVALID" | "EXPIRED";
|
|
97
|
+
export type scanResult = {
|
|
98
|
+
data: any;
|
|
99
|
+
error: Error | null;
|
|
100
|
+
};
|
|
101
|
+
export interface vcSubmissionBody {
|
|
102
|
+
vc: any;
|
|
103
|
+
transactionId?: string;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
package/dist/index.d.ts
ADDED