@didit-protocol/sdk-web 0.3.0 → 0.4.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/dist/index.d.ts CHANGED
@@ -15,6 +15,11 @@ interface VerificationResult {
15
15
  session?: SessionData;
16
16
  error?: VerificationError;
17
17
  }
18
+ /**
19
+ * A physical camera on the end user's device. Mirrors the `CameraLens` option
20
+ * of the native SDKs.
21
+ */
22
+ type CameraLens = "front" | "back";
18
23
  interface DiditSdkConfiguration {
19
24
  loggingEnabled?: boolean;
20
25
  containerElement?: HTMLElement;
@@ -24,6 +29,40 @@ interface DiditSdkConfiguration {
24
29
  closeModalOnComplete?: boolean;
25
30
  embedded?: boolean;
26
31
  embeddedContainerId?: string;
32
+ /**
33
+ * The camera the document capture opens first. `"back"` (the default) is
34
+ * the rear camera; `"front"` opens the selfie camera. A device without the
35
+ * requested camera keeps the other one. Forwarded to the verification page
36
+ * as the `document_camera` query parameter of the verification URL.
37
+ * @default "back"
38
+ */
39
+ defaultDocumentCamera?: CameraLens;
40
+ /**
41
+ * The camera the face (liveness) capture opens first. `"front"` (the
42
+ * default) is the selfie camera; `"back"` opens the rear camera, for a
43
+ * kiosk or an operator pointing the device at the person being verified.
44
+ * Applies to the passive liveness check; a device without a rear camera
45
+ * keeps the front one. Forwarded to the verification page as the
46
+ * `liveness_camera` query parameter of the verification URL.
47
+ * @default "front"
48
+ */
49
+ defaultLivenessCamera?: CameraLens;
50
+ /**
51
+ * Show the in-capture camera switcher on the document step. Set `false` to
52
+ * lock the user to `defaultDocumentCamera`. The switcher is hidden anyway
53
+ * on a device with a single camera. Forwarded as the
54
+ * `document_camera_switch` query parameter.
55
+ * @default true
56
+ */
57
+ showDocumentCameraSwitchButton?: boolean;
58
+ /**
59
+ * Show the in-capture camera switcher on the face (liveness) step. Set
60
+ * `false` to lock the user to `defaultLivenessCamera`. The switcher is
61
+ * hidden anyway on a device with a single camera. Forwarded as the
62
+ * `liveness_camera_switch` query parameter.
63
+ * @default true
64
+ */
65
+ showLivenessCameraSwitchButton?: boolean;
27
66
  }
28
67
  interface StartVerificationOptions {
29
68
  url: string;
@@ -333,7 +372,7 @@ declare class DiditTransactionError extends Error {
333
372
  });
334
373
  }
335
374
 
336
- declare const SDK_VERSION = "0.2.1";
375
+ declare const SDK_VERSION = "0.4.0";
337
376
 
338
377
  export { DEFAULT_TRANSACTION_BASE_URL, DiditSdk, DiditTransactionError, SDK_VERSION, DiditSdk as default };
339
- export type { 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 };
378
+ 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@didit-protocol/sdk-web",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Didit Identity Verification SDK for Web Applications",
5
5
  "main": "dist/didit-sdk.cjs.js",
6
6
  "module": "dist/didit-sdk.esm.js",
@@ -20,6 +20,9 @@
20
20
  "build:watch": "rollup -c -w",
21
21
  "dev": "node examples/server.js",
22
22
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
23
+ "test:build-version": "npm run build && node scripts/verify-build-version.mjs",
24
+ "test:e2e": "npm run build && playwright test --project=chromium --project=firefox --project=webkit",
25
+ "test:visual": "npm run build && playwright test --project=chrome-visual",
23
26
  "test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
24
27
  "typecheck": "tsc --noEmit",
25
28
  "clean": "rm -rf dist",
@@ -46,6 +49,7 @@
46
49
  "access": "public"
47
50
  },
48
51
  "devDependencies": {
52
+ "@playwright/test": "^1.61.0",
49
53
  "@rollup/plugin-node-resolve": "^15.2.3",
50
54
  "@rollup/plugin-typescript": "^11.1.6",
51
55
  "@types/jest": "^29.5.12",