@didit-protocol/sdk-web 0.4.0 → 0.5.1
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 +93 -0
- package/dist/didit-sdk.cjs +2326 -0
- package/dist/didit-sdk.cjs.js +422 -376
- package/dist/didit-sdk.cjs.js.map +1 -1
- package/dist/didit-sdk.cjs.map +1 -0
- package/dist/didit-sdk.esm.js +1665 -856
- package/dist/didit-sdk.esm.js.map +1 -1
- package/dist/didit-sdk.module.js +2313 -0
- package/dist/didit-sdk.module.js.map +1 -0
- package/dist/didit-sdk.umd.js +1631 -815
- package/dist/didit-sdk.umd.js.map +1 -1
- package/dist/didit-sdk.umd.min.js +2 -2
- package/dist/didit-sdk.umd.min.js.map +1 -1
- package/dist/index.d.ts +25 -1
- package/package.json +31 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { SubmitEventOptions } from '@didit-protocol/signals';
|
|
2
|
+
export * from '@didit-protocol/signals';
|
|
3
|
+
|
|
1
4
|
type DiditSdkState = "idle" | "loading" | "ready" | "error";
|
|
2
5
|
type VerificationStatus = "Approved" | "Pending" | "Declined";
|
|
3
6
|
interface SessionData {
|
|
@@ -329,6 +332,27 @@ declare class DiditSdk {
|
|
|
329
332
|
* "validation" (with fieldErrors) or "network".
|
|
330
333
|
*/
|
|
331
334
|
submitTransaction(options: SubmitTransactionOptions): Promise<SubmitTransactionResult>;
|
|
335
|
+
/**
|
|
336
|
+
* Queues an end-user event (sign-up, login, failed login, logout, password
|
|
337
|
+
* reset, MFA, device change...) for Didit's event monitoring, so it appears
|
|
338
|
+
* in the console tied to the same person as their verifications and
|
|
339
|
+
* transactions. Returns the event id.
|
|
340
|
+
*
|
|
341
|
+
* The request is authenticated with a short-lived monitoring token minted by
|
|
342
|
+
* your backend for that person (POST /v3/events/sdk-token/) and sent via the
|
|
343
|
+
* X-Monitoring-Token header; the person always comes from the token. Events
|
|
344
|
+
* are batched to /v1/events/batch/ with the device fingerprint attached, and
|
|
345
|
+
* sent when 25 are waiting, every 5 seconds and when the page is hidden or
|
|
346
|
+
* closed. Tune the queue with `configureEvents` and send right away with
|
|
347
|
+
* `flush`, both exported by this package.
|
|
348
|
+
*
|
|
349
|
+
* @param options monitoringToken, the event and an optional baseUrl
|
|
350
|
+
* (defaults to https://verification.didit.me).
|
|
351
|
+
* @returns The event id: yours when you set event.eventId, otherwise a new UUID.
|
|
352
|
+
* @throws {DiditEventError} "invalid_token" without a monitoringToken,
|
|
353
|
+
* "validation" without an event category and action type.
|
|
354
|
+
*/
|
|
355
|
+
submitEvent(options: SubmitEventOptions): string;
|
|
332
356
|
/**
|
|
333
357
|
* Dismisses everything currently on screen in one deterministic call: a
|
|
334
358
|
* pending transaction action modal is treated as an abort (no follow-up
|
|
@@ -372,7 +396,7 @@ declare class DiditTransactionError extends Error {
|
|
|
372
396
|
});
|
|
373
397
|
}
|
|
374
398
|
|
|
375
|
-
declare const SDK_VERSION = "0.
|
|
399
|
+
declare const SDK_VERSION = "0.5.1";
|
|
376
400
|
|
|
377
401
|
export { DEFAULT_TRANSACTION_BASE_URL, DiditSdk, DiditTransactionError, SDK_VERSION, DiditSdk as default };
|
|
378
402
|
export type { CameraLens, DiditSdkConfiguration, DiditSdkState, DiditTransactionDetails, DiditTransactionParticipant, DiditTransactionPayload, DiditTransactionPaymentMethod, DiditTravelRuleDetails, EventCallback, SessionData, StartVerificationOptions, StateChangeCallback, SubmitTransactionOptions, SubmitTransactionResult, TransactionActionCompletedCallback, TransactionActionCompletedError, TransactionActionRequired, TransactionActionType, TransactionErrorType, VerificationCallback, VerificationError, VerificationErrorType, VerificationEvent, VerificationEventData, VerificationEventType, VerificationResult, VerificationResultType, VerificationStatus };
|
package/package.json
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@didit-protocol/sdk-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Didit Identity Verification SDK for Web Applications",
|
|
5
|
-
"main": "dist/didit-sdk.cjs
|
|
6
|
-
"module": "dist/didit-sdk.
|
|
5
|
+
"main": "dist/didit-sdk.cjs",
|
|
6
|
+
"module": "dist/didit-sdk.module.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/didit-sdk.module.js",
|
|
12
|
+
"require": "./dist/didit-sdk.cjs"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
+
"workspaces": [
|
|
19
|
+
"packages/*",
|
|
20
|
+
"examples/*"
|
|
21
|
+
],
|
|
18
22
|
"scripts": {
|
|
19
|
-
"build": "rollup -c",
|
|
23
|
+
"build": "npm run build -w @didit-protocol/signals && rollup -c",
|
|
20
24
|
"build:watch": "rollup -c -w",
|
|
21
25
|
"dev": "node examples/server.js",
|
|
22
26
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
@@ -24,9 +28,16 @@
|
|
|
24
28
|
"test:e2e": "npm run build && playwright test --project=chromium --project=firefox --project=webkit",
|
|
25
29
|
"test:visual": "npm run build && playwright test --project=chrome-visual",
|
|
26
30
|
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
|
|
27
|
-
"typecheck": "tsc --noEmit",
|
|
28
|
-
"clean": "rm -rf dist",
|
|
29
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
31
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p packages/signals",
|
|
32
|
+
"clean": "rm -rf dist packages/signals/dist",
|
|
33
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
34
|
+
"test:size": "npm run test:size -w @didit-protocol/signals",
|
|
35
|
+
"test:packages": "npm run build:auth && node scripts/verify-packages.mjs",
|
|
36
|
+
"test:release": "node --test scripts/auth-release.test.mjs",
|
|
37
|
+
"build:auth": "npm run build -w @didit-protocol/signals -w @didit-protocol/auth -w @didit-protocol/auth-react -w @didit-protocol/auth-nextjs",
|
|
38
|
+
"test:auth": "npm run test -w @didit-protocol/auth-react -w @didit-protocol/auth-nextjs",
|
|
39
|
+
"typecheck:auth": "npm run typecheck -w @didit-protocol/auth-react -w @didit-protocol/auth-nextjs",
|
|
40
|
+
"lint": "eslint packages/auth-react/src packages/auth-nextjs/src examples/nextjs examples/react examples/shared"
|
|
30
41
|
},
|
|
31
42
|
"keywords": [
|
|
32
43
|
"didit",
|
|
@@ -48,19 +59,26 @@
|
|
|
48
59
|
"registry": "https://registry.npmjs.org/",
|
|
49
60
|
"access": "public"
|
|
50
61
|
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@didit-protocol/signals": "^0.1.0"
|
|
64
|
+
},
|
|
51
65
|
"devDependencies": {
|
|
52
66
|
"@playwright/test": "^1.61.0",
|
|
53
67
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
68
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
54
69
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
55
70
|
"@types/jest": "^29.5.12",
|
|
71
|
+
"eslint": "^9.39.5",
|
|
56
72
|
"jest": "^29.7.0",
|
|
57
73
|
"jest-environment-jsdom": "^29.7.0",
|
|
58
|
-
"rollup": "^4.
|
|
74
|
+
"rollup": "^4.59.0",
|
|
59
75
|
"rollup-plugin-dts": "^6.1.0",
|
|
60
|
-
"
|
|
76
|
+
"terser": "^5.31.0",
|
|
61
77
|
"ts-jest": "^29.1.2",
|
|
62
78
|
"tslib": "^2.6.2",
|
|
63
|
-
"typescript": "^5.3.3"
|
|
79
|
+
"typescript": "^5.3.3",
|
|
80
|
+
"typescript-eslint": "^8.71.1",
|
|
81
|
+
"vite": "^7.3.7"
|
|
64
82
|
},
|
|
65
83
|
"engines": {
|
|
66
84
|
"node": ">=16.0.0"
|