@kwik-id/sdk-node 0.1.0-alpha.3 → 0.1.0-alpha.7
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 +39 -29
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @kwik-id/sdk-node
|
|
2
2
|
|
|
3
|
-
Server-side Node.js SDK for [KwikID](https://
|
|
3
|
+
Server-side Node.js SDK for [KwikID](https://identity.kwiknkap.com) identity verification. Create verification sessions, retrieve results, and verify webhook signatures.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -44,8 +44,8 @@ console.log(result.extractedData); // { firstName, lastName, dateOfBirth, ... }
|
|
|
44
44
|
|
|
45
45
|
```ts
|
|
46
46
|
const kwikId = new KwikIDNode({
|
|
47
|
-
apiKey: "your-api-key", // Required — from KwikID dashboard
|
|
48
|
-
baseUrl: "https://api.
|
|
47
|
+
apiKey: "your-api-key", // Required — from KwikID dashboard at identity.kwiknkap.com
|
|
48
|
+
baseUrl: "https://api.identity.kwiknkap.com", // Optional — defaults to production
|
|
49
49
|
timeout: 30000, // Optional — request timeout in ms (default: 30s)
|
|
50
50
|
});
|
|
51
51
|
```
|
|
@@ -130,19 +130,18 @@ Gets the detailed result including scores and extracted document data.
|
|
|
130
130
|
const result = await kwikId.getVerificationResult(jobId);
|
|
131
131
|
|
|
132
132
|
// Scores (0–1 scale)
|
|
133
|
-
result.scores?.overall;
|
|
134
|
-
result.scores?.liveness;
|
|
135
|
-
result.scores?.document;
|
|
136
|
-
result.scores?.faceMatch;
|
|
133
|
+
result.scores?.overall; // Combined score
|
|
134
|
+
result.scores?.liveness; // Liveness detection score
|
|
135
|
+
result.scores?.document; // Document authenticity score
|
|
136
|
+
result.scores?.faceMatch; // Face match score
|
|
137
137
|
|
|
138
138
|
// Extracted document data (from OCR)
|
|
139
139
|
result.extractedData?.firstName;
|
|
140
140
|
result.extractedData?.lastName;
|
|
141
|
-
result.extractedData?.dateOfBirth;
|
|
142
|
-
result.extractedData?.idNumber;
|
|
143
|
-
result.extractedData?.expiryDate;
|
|
141
|
+
result.extractedData?.dateOfBirth; // YYYY-MM-DD
|
|
142
|
+
result.extractedData?.idNumber; // Document number
|
|
143
|
+
result.extractedData?.expiryDate; // YYYY-MM-DD
|
|
144
144
|
result.extractedData?.documentType;
|
|
145
|
-
result.extractedData?.country;
|
|
146
145
|
```
|
|
147
146
|
|
|
148
147
|
### Webhooks
|
|
@@ -202,30 +201,41 @@ app.post("/webhooks/kwikid", (req, res) => {
|
|
|
202
201
|
|
|
203
202
|
```ts
|
|
204
203
|
{
|
|
205
|
-
event: "verification.completed",
|
|
204
|
+
event: "verification.completed", // WebhookEventType
|
|
206
205
|
timestamp: "2024-01-15T10:30:00.000Z",
|
|
207
206
|
data: {
|
|
208
207
|
jobId: "job_abc123",
|
|
209
|
-
referenceId: "user_123",
|
|
208
|
+
referenceId: "user_123", // your reference ID (if provided at session creation)
|
|
210
209
|
status: "verified",
|
|
211
|
-
environment: "live",
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
environment: "live", // "live" | "test"
|
|
211
|
+
|
|
212
|
+
// Scores — present on completed/rejected events
|
|
213
|
+
scores?: {
|
|
214
|
+
documentScore?: number; // 0–1
|
|
215
|
+
documentBackScore?: number; // 0–1 (if back was captured)
|
|
216
|
+
faceMatchScore?: number; // 0–1
|
|
217
|
+
livenessScore?: number; // 0–1
|
|
216
218
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
|
|
220
|
+
// Extracted OCR data — present on completed events
|
|
221
|
+
extractedData?: {
|
|
222
|
+
firstName?: string;
|
|
223
|
+
lastName?: string;
|
|
224
|
+
fullName?: string;
|
|
225
|
+
dateOfBirth?: string; // YYYY-MM-DD
|
|
226
|
+
documentNumber?: string;
|
|
227
|
+
uniqueIdentifier?: string;
|
|
228
|
+
nationality?: string;
|
|
229
|
+
expiryDate?: string; // YYYY-MM-DD
|
|
230
|
+
issuanceDate?: string; // YYYY-MM-DD
|
|
231
|
+
documentType?: string;
|
|
227
232
|
},
|
|
228
|
-
|
|
233
|
+
|
|
234
|
+
// Error info — present on failed events
|
|
235
|
+
errorCode?: string;
|
|
236
|
+
errorMessage?: string;
|
|
237
|
+
|
|
238
|
+
metadata?: Record<string, unknown>;
|
|
229
239
|
}
|
|
230
240
|
}
|
|
231
241
|
```
|
package/dist/package.json
CHANGED