smartcomply-web-sdk 1.0.3

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.
Files changed (133) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +482 -0
  3. package/dist/camera/ActionDetector.d.ts +26 -0
  4. package/dist/camera/ActionDetector.d.ts.map +1 -0
  5. package/dist/camera/ActionDetector.js +114 -0
  6. package/dist/camera/ActionDetector.js.map +1 -0
  7. package/dist/camera/CameraManager.d.ts +7 -0
  8. package/dist/camera/CameraManager.d.ts.map +1 -0
  9. package/dist/camera/CameraManager.js +31 -0
  10. package/dist/camera/CameraManager.js.map +1 -0
  11. package/dist/camera/FaceDetector.d.ts +12 -0
  12. package/dist/camera/FaceDetector.d.ts.map +1 -0
  13. package/dist/camera/FaceDetector.js +55 -0
  14. package/dist/camera/FaceDetector.js.map +1 -0
  15. package/dist/camera/Permission.d.ts +42 -0
  16. package/dist/camera/Permission.d.ts.map +1 -0
  17. package/dist/camera/Permission.js +107 -0
  18. package/dist/camera/Permission.js.map +1 -0
  19. package/dist/camera/VideoRecorder.d.ts +12 -0
  20. package/dist/camera/VideoRecorder.d.ts.map +1 -0
  21. package/dist/camera/VideoRecorder.js +51 -0
  22. package/dist/camera/VideoRecorder.js.map +1 -0
  23. package/dist/client/Config.d.ts +9 -0
  24. package/dist/client/Config.d.ts.map +1 -0
  25. package/dist/client/Config.js +8 -0
  26. package/dist/client/Config.js.map +1 -0
  27. package/dist/client/HttpClient.d.ts +44 -0
  28. package/dist/client/HttpClient.d.ts.map +1 -0
  29. package/dist/client/HttpClient.js +149 -0
  30. package/dist/client/HttpClient.js.map +1 -0
  31. package/dist/client/Smartcomply.d.ts +50 -0
  32. package/dist/client/Smartcomply.d.ts.map +1 -0
  33. package/dist/client/Smartcomply.js +77 -0
  34. package/dist/client/Smartcomply.js.map +1 -0
  35. package/dist/components/CameraView.d.ts +59 -0
  36. package/dist/components/CameraView.d.ts.map +1 -0
  37. package/dist/components/CameraView.js +242 -0
  38. package/dist/components/CameraView.js.map +1 -0
  39. package/dist/components/DocumentUpload.d.ts +21 -0
  40. package/dist/components/DocumentUpload.d.ts.map +1 -0
  41. package/dist/components/DocumentUpload.js +220 -0
  42. package/dist/components/DocumentUpload.js.map +1 -0
  43. package/dist/errors/AuthError.d.ts +8 -0
  44. package/dist/errors/AuthError.d.ts.map +1 -0
  45. package/dist/errors/AuthError.js +15 -0
  46. package/dist/errors/AuthError.js.map +1 -0
  47. package/dist/errors/NetworkError.d.ts +8 -0
  48. package/dist/errors/NetworkError.d.ts.map +1 -0
  49. package/dist/errors/NetworkError.js +15 -0
  50. package/dist/errors/NetworkError.js.map +1 -0
  51. package/dist/errors/SDKError.d.ts +7 -0
  52. package/dist/errors/SDKError.d.ts.map +1 -0
  53. package/dist/errors/SDKError.js +14 -0
  54. package/dist/errors/SDKError.js.map +1 -0
  55. package/dist/flow/DocumentCapture.d.ts +54 -0
  56. package/dist/flow/DocumentCapture.d.ts.map +1 -0
  57. package/dist/flow/DocumentCapture.js +801 -0
  58. package/dist/flow/DocumentCapture.js.map +1 -0
  59. package/dist/flow/SmartComplyFlow.d.ts +104 -0
  60. package/dist/flow/SmartComplyFlow.d.ts.map +1 -0
  61. package/dist/flow/SmartComplyFlow.js +1726 -0
  62. package/dist/flow/SmartComplyFlow.js.map +1 -0
  63. package/dist/flow/theme.d.ts +30 -0
  64. package/dist/flow/theme.d.ts.map +1 -0
  65. package/dist/flow/theme.js +103 -0
  66. package/dist/flow/theme.js.map +1 -0
  67. package/dist/index.d.ts +20 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +29 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/modules/liveness/LivenessUI.d.ts +46 -0
  72. package/dist/modules/liveness/LivenessUI.d.ts.map +1 -0
  73. package/dist/modules/liveness/LivenessUI.js +609 -0
  74. package/dist/modules/liveness/LivenessUI.js.map +1 -0
  75. package/dist/modules/liveness/index.d.ts +5 -0
  76. package/dist/modules/liveness/index.d.ts.map +1 -0
  77. package/dist/modules/liveness/index.js +10 -0
  78. package/dist/modules/liveness/index.js.map +1 -0
  79. package/dist/modules/liveness/liveness.d.ts +85 -0
  80. package/dist/modules/liveness/liveness.d.ts.map +1 -0
  81. package/dist/modules/liveness/liveness.js +425 -0
  82. package/dist/modules/liveness/liveness.js.map +1 -0
  83. package/dist/modules/liveness/uploader.d.ts +34 -0
  84. package/dist/modules/liveness/uploader.d.ts.map +1 -0
  85. package/dist/modules/liveness/uploader.js +106 -0
  86. package/dist/modules/liveness/uploader.js.map +1 -0
  87. package/dist/modules/onboarding/index.d.ts +2 -0
  88. package/dist/modules/onboarding/index.d.ts.map +1 -0
  89. package/dist/modules/onboarding/index.js +6 -0
  90. package/dist/modules/onboarding/index.js.map +1 -0
  91. package/dist/modules/onboarding/onboarding.d.ts +25 -0
  92. package/dist/modules/onboarding/onboarding.d.ts.map +1 -0
  93. package/dist/modules/onboarding/onboarding.js +33 -0
  94. package/dist/modules/onboarding/onboarding.js.map +1 -0
  95. package/dist/smartcomply.browser.js +8147 -0
  96. package/dist/smartcomply.browser.js.map +7 -0
  97. package/dist/types/common.d.ts +27 -0
  98. package/dist/types/common.d.ts.map +1 -0
  99. package/dist/types/common.js +3 -0
  100. package/dist/types/common.js.map +1 -0
  101. package/dist/types/liveness.d.ts +142 -0
  102. package/dist/types/liveness.d.ts.map +1 -0
  103. package/dist/types/liveness.js +3 -0
  104. package/dist/types/liveness.js.map +1 -0
  105. package/dist/types/onboarding.d.ts +53 -0
  106. package/dist/types/onboarding.d.ts.map +1 -0
  107. package/dist/types/onboarding.js +3 -0
  108. package/dist/types/onboarding.js.map +1 -0
  109. package/dist/types/quality.d.ts +23 -0
  110. package/dist/types/quality.d.ts.map +1 -0
  111. package/dist/types/quality.js +6 -0
  112. package/dist/types/quality.js.map +1 -0
  113. package/dist/utils/ImageQuality.d.ts +48 -0
  114. package/dist/utils/ImageQuality.d.ts.map +1 -0
  115. package/dist/utils/ImageQuality.js +186 -0
  116. package/dist/utils/ImageQuality.js.map +1 -0
  117. package/dist/utils/constants.d.ts +59 -0
  118. package/dist/utils/constants.d.ts.map +1 -0
  119. package/dist/utils/constants.js +70 -0
  120. package/dist/utils/constants.js.map +1 -0
  121. package/dist/utils/device.d.ts +14 -0
  122. package/dist/utils/device.d.ts.map +1 -0
  123. package/dist/utils/device.js +55 -0
  124. package/dist/utils/device.js.map +1 -0
  125. package/dist/utils/logger.d.ts +28 -0
  126. package/dist/utils/logger.d.ts.map +1 -0
  127. package/dist/utils/logger.js +67 -0
  128. package/dist/utils/logger.js.map +1 -0
  129. package/dist/utils/validator.d.ts +35 -0
  130. package/dist/utils/validator.d.ts.map +1 -0
  131. package/dist/utils/validator.js +116 -0
  132. package/dist/utils/validator.js.map +1 -0
  133. package/package.json +51 -0
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * SDK-wide constants — single source of truth for limits, defaults and
4
+ * backend-defined magic values.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.OVERLAY_Z_INDEX = exports.FINGERPRINT_STORAGE_KEY = exports.RESULT_OVERLAY_DURATION_MS = exports.FACE_DETECT_POLL_MS = exports.FACE_DETECT_TIMEOUT_MS = exports.RECORDING_BITS_PER_SECOND = exports.DOC_CAMERA_IDEAL_HEIGHT = exports.DOC_CAMERA_IDEAL_WIDTH = exports.CAMERA_IDEAL_HEIGHT = exports.CAMERA_IDEAL_WIDTH = exports.POST_ACTION_SETTLE_MS = exports.LIVENESS_TIME_LIMIT_SECONDS = exports.DEFAULT_CHALLENGE_ACTIONS = exports.CHALLENGE_ACTIONS = exports.CAPTURE_JPEG_QUALITY = exports.ACCEPTED_IMAGE_TYPES = exports.MAX_SNAPSHOT_BYTES = exports.MAX_VIDEO_BYTES = exports.MAX_DOCUMENT_BYTES = exports.RETRY_DELAY_MS = exports.MAX_RETRIES = exports.DEFAULT_TIMEOUT_MS = exports.SESSION_WARN_BEFORE_MS = exports.SESSION_TTL_MS = exports.ENDPOINTS = void 0;
8
+ // ── API endpoints ────────────────────────────────────────────────────────────
9
+ exports.ENDPOINTS = {
10
+ SESSION_CREATE: "/v1/sdk/session/create/",
11
+ SDK_INITIALIZE: "/v1/sdk/initialize/",
12
+ ONBOARDING_VERIFY: "/v1/sdk/onboarding/verify/",
13
+ LIVENESS_CREATE: "/v1/sdk/liveness/create/",
14
+ LIVENESS_SUBMIT: "/v1/sdk/liveness/submit/",
15
+ AVAILABLE_CHANNELS: "/v1/sdk/available-channels/",
16
+ };
17
+ // ── Session ──────────────────────────────────────────────────────────────────
18
+ /** Backend session TTL in milliseconds (30 minutes). */
19
+ exports.SESSION_TTL_MS = 30 * 60 * 1000;
20
+ /** Warn the user this many ms before session expires. */
21
+ exports.SESSION_WARN_BEFORE_MS = 2 * 60 * 1000;
22
+ // ── Network ──────────────────────────────────────────────────────────────────
23
+ /** Default request timeout in milliseconds. */
24
+ exports.DEFAULT_TIMEOUT_MS = 30000;
25
+ /** Number of automatic retries on transient network errors. */
26
+ exports.MAX_RETRIES = 2;
27
+ /** Delay between retries in milliseconds. */
28
+ exports.RETRY_DELAY_MS = 1000;
29
+ // ── File uploads ─────────────────────────────────────────────────────────────
30
+ /** Maximum document image size the backend accepts (5 MB). */
31
+ exports.MAX_DOCUMENT_BYTES = 5 * 1024 * 1024;
32
+ /** Maximum video size the backend accepts (50 MB). */
33
+ exports.MAX_VIDEO_BYTES = 50 * 1024 * 1024;
34
+ /** Maximum snapshot / autoshot size (2 MB). */
35
+ exports.MAX_SNAPSHOT_BYTES = 2 * 1024 * 1024;
36
+ /** Accepted MIME types for document images. */
37
+ exports.ACCEPTED_IMAGE_TYPES = ["image/jpeg", "image/png", "image/webp"];
38
+ /** JPEG quality used when encoding captured frames (0–1). */
39
+ exports.CAPTURE_JPEG_QUALITY = 0.92;
40
+ // ── Liveness challenge ───────────────────────────────────────────────────────
41
+ /** Backend-accepted challenge actions (UPPERCASE). */
42
+ exports.CHALLENGE_ACTIONS = ["BLINK", "TURN_LEFT", "TURN_RIGHT", "TURN_HEAD", "OPEN_MOUTH"];
43
+ /** Default set sent when the caller does not specify actions. */
44
+ exports.DEFAULT_CHALLENGE_ACTIONS = ["BLINK", "TURN_LEFT", "OPEN_MOUTH"];
45
+ /** Time limit per liveness attempt in seconds. */
46
+ exports.LIVENESS_TIME_LIMIT_SECONDS = 45;
47
+ /** Milliseconds to pause after all actions before capturing the final snapshot. */
48
+ exports.POST_ACTION_SETTLE_MS = 800;
49
+ // ── Camera ───────────────────────────────────────────────────────────────────
50
+ /** Ideal resolution for the front-facing liveness camera. */
51
+ exports.CAMERA_IDEAL_WIDTH = 640;
52
+ exports.CAMERA_IDEAL_HEIGHT = 480;
53
+ /** Ideal resolution for rear-facing document capture camera. */
54
+ exports.DOC_CAMERA_IDEAL_WIDTH = 1280;
55
+ exports.DOC_CAMERA_IDEAL_HEIGHT = 960;
56
+ /** Video bitrate used by MediaRecorder for liveness recordings (~1.4 MB / 45 s). */
57
+ exports.RECORDING_BITS_PER_SECOND = 250000;
58
+ // ── Face detection ───────────────────────────────────────────────────────────
59
+ /** Max milliseconds to wait for an initial face detection before proceeding. */
60
+ exports.FACE_DETECT_TIMEOUT_MS = 10000;
61
+ /** Polling interval for the face-present check (ms). */
62
+ exports.FACE_DETECT_POLL_MS = 100;
63
+ // ── UI / UX ──────────────────────────────────────────────────────────────────
64
+ /** How long (ms) the success overlay is shown before the flow advances. */
65
+ exports.RESULT_OVERLAY_DURATION_MS = 2800;
66
+ /** localStorage key used to persist the browser fingerprint ID. */
67
+ exports.FINGERPRINT_STORAGE_KEY = "_adhere_fid";
68
+ /** z-index for the SDK overlay — high enough to sit above any app content. */
69
+ exports.OVERLAY_Z_INDEX = 99999;
70
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gFAAgF;AAEn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QAAA,qBAAqB,GAAG,GAAG,CAAC;AAEzC,gFAAgF;AAEhF,6DAA6D;AAChD,QAAA,kBAAkB,GAAI,GAAG,CAAC;AAC1B,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC,gEAAgE;AACnD,QAAA,sBAAsB,GAAI,IAAI,CAAC;AAC/B,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAE3C,oFAAoF;AACvE,QAAA,yBAAyB,GAAG,MAAO,CAAC;AAEjD,gFAAgF;AAEhF,gFAAgF;AACnE,QAAA,sBAAsB,GAAG,KAAM,CAAC;AAE7C,wDAAwD;AAC3C,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC,gFAAgF;AAEhF,2EAA2E;AAC9D,QAAA,0BAA0B,GAAG,IAAK,CAAC;AAEhD,mEAAmE;AACtD,QAAA,uBAAuB,GAAG,aAAa,CAAC;AAErD,8EAA8E;AACjE,QAAA,eAAe,GAAG,KAAM,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Collects device / browser context metadata.
3
+ * All values are derived from standard browser APIs — no external library needed.
4
+ * Sent to the backend at liveness/create so they appear in the webhook
5
+ * request_context block.
6
+ */
7
+ export interface DeviceMetadata {
8
+ device_type: "mobile" | "desktop" | "tablet";
9
+ os_name: string;
10
+ browser_timezone: string;
11
+ fingerprint_id: string;
12
+ }
13
+ export declare function collectDeviceMetadata(): DeviceMetadata;
14
+ //# sourceMappingURL=device.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/utils/device.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AA8BD,wBAAgB,qBAAqB,IAAI,cAAc,CAuBtD"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.collectDeviceMetadata = collectDeviceMetadata;
4
+ function detectOs(ua) {
5
+ if (/Windows NT/i.test(ua))
6
+ return "Windows";
7
+ if (/Mac OS X|Macintosh/i.test(ua))
8
+ return "macOS";
9
+ if (/Android/i.test(ua))
10
+ return "Android";
11
+ if (/iPhone|iPad|iPod/i.test(ua))
12
+ return "iOS";
13
+ if (/Linux/i.test(ua))
14
+ return "Linux";
15
+ if (/CrOS/i.test(ua))
16
+ return "ChromeOS";
17
+ return "Unknown";
18
+ }
19
+ function getOrCreateFingerprintId() {
20
+ const KEY = "_adhere_fid";
21
+ try {
22
+ let fid = localStorage.getItem(KEY);
23
+ if (!fid) {
24
+ fid =
25
+ typeof crypto !== "undefined" && typeof crypto.randomUUID === "function"
26
+ ? crypto.randomUUID()
27
+ : Math.random().toString(36).slice(2) + Date.now().toString(36);
28
+ localStorage.setItem(KEY, fid);
29
+ }
30
+ return fid;
31
+ }
32
+ catch {
33
+ // localStorage unavailable (e.g. private browsing with strict settings)
34
+ return Math.random().toString(36).slice(2) + Date.now().toString(36);
35
+ }
36
+ }
37
+ function collectDeviceMetadata() {
38
+ const ua = navigator.userAgent;
39
+ const isTablet = /iPad/i.test(ua) ||
40
+ (/Android/i.test(ua) && !/Mobile/i.test(ua));
41
+ const isMobile = !isTablet &&
42
+ /Mobi|Android|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua);
43
+ const device_type = isTablet
44
+ ? "tablet"
45
+ : isMobile
46
+ ? "mobile"
47
+ : "desktop";
48
+ return {
49
+ device_type,
50
+ os_name: detectOs(ua),
51
+ browser_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
52
+ fingerprint_id: getOrCreateFingerprintId(),
53
+ };
54
+ }
55
+ //# sourceMappingURL=device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/utils/device.ts"],"names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CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,SAAgB,qBAAqB;IACnC,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;IAE/B,MAAM,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAE/C,MAAM,QAAQ,GACZ,CAAC,QAAQ;QACT,0DAA0D,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEtE,MAAM,WAAW,GAAkC,QAAQ;QACzD,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO;QACL,WAAW;QACX,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;QACrB,gBAAgB,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;QAClE,cAAc,EAAE,wBAAwB,EAAE;KAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Lightweight SDK logger.
3
+ *
4
+ * Debug output is suppressed in production. Enable verbose logging by calling
5
+ * SDKLogger.setDebug(true) before initialising the SDK, or by setting the
6
+ * global flag: window.__SC_DEBUG__ = true
7
+ */
8
+ export declare const SDKLogger: {
9
+ /** Emit an informational message (debug mode only). */
10
+ info(message: string, ...args: unknown[]): void;
11
+ /** Emit a warning (always visible). */
12
+ warn(message: string, ...args: unknown[]): void;
13
+ /** Emit an error (always visible). */
14
+ error(message: string, ...args: unknown[]): void;
15
+ /** Emit a debug trace (debug mode only — lowest priority). */
16
+ debug(message: string, ...args: unknown[]): void;
17
+ /** Log a timed group of related messages (debug mode only). */
18
+ group(label: string, fn: () => void): void;
19
+ /**
20
+ * Enable or disable verbose debug output at runtime.
21
+ *
22
+ * Example:
23
+ * import { SDKLogger } from "smartcomply-web-sdk";
24
+ * SDKLogger.setDebug(true);
25
+ */
26
+ setDebug(enabled: boolean): void;
27
+ };
28
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,eAAO,MAAM,SAAS;IACpB,uDAAuD;kBACzC,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;IAK/C,uCAAuC;kBACzB,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;IAI/C,sCAAsC;mBACvB,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;IAIhD,8DAA8D;mBAC/C,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;IAKhD,+DAA+D;iBAClD,MAAM,MAAM,MAAM,IAAI,GAAG,IAAI;IAO1C;;;;;;OAMG;sBACe,OAAO,GAAG,IAAI;CAOjC,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /**
3
+ * Lightweight SDK logger.
4
+ *
5
+ * Debug output is suppressed in production. Enable verbose logging by calling
6
+ * SDKLogger.setDebug(true) before initialising the SDK, or by setting the
7
+ * global flag: window.__SC_DEBUG__ = true
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SDKLogger = void 0;
11
+ const PREFIX = "[SmartComply SDK]";
12
+ function isDebugEnabled() {
13
+ try {
14
+ return !!window.__SC_DEBUG__;
15
+ }
16
+ catch {
17
+ return false;
18
+ }
19
+ }
20
+ exports.SDKLogger = {
21
+ /** Emit an informational message (debug mode only). */
22
+ info(message, ...args) {
23
+ if (!isDebugEnabled())
24
+ return;
25
+ console.info(`${PREFIX} ℹ ${message}`, ...args);
26
+ },
27
+ /** Emit a warning (always visible). */
28
+ warn(message, ...args) {
29
+ console.warn(`${PREFIX} ⚠ ${message}`, ...args);
30
+ },
31
+ /** Emit an error (always visible). */
32
+ error(message, ...args) {
33
+ console.error(`${PREFIX} ✖ ${message}`, ...args);
34
+ },
35
+ /** Emit a debug trace (debug mode only — lowest priority). */
36
+ debug(message, ...args) {
37
+ if (!isDebugEnabled())
38
+ return;
39
+ console.debug(`${PREFIX} ⬡ ${message}`, ...args);
40
+ },
41
+ /** Log a timed group of related messages (debug mode only). */
42
+ group(label, fn) {
43
+ if (!isDebugEnabled()) {
44
+ fn();
45
+ return;
46
+ }
47
+ console.group(`${PREFIX} ${label}`);
48
+ fn();
49
+ console.groupEnd();
50
+ },
51
+ /**
52
+ * Enable or disable verbose debug output at runtime.
53
+ *
54
+ * Example:
55
+ * import { SDKLogger } from "smartcomply-web-sdk";
56
+ * SDKLogger.setDebug(true);
57
+ */
58
+ setDebug(enabled) {
59
+ try {
60
+ window.__SC_DEBUG__ = enabled;
61
+ }
62
+ catch {
63
+ /* no-op in non-browser environments */
64
+ }
65
+ },
66
+ };
67
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAO,CAAC,CAAE,MAAc,CAAC,YAAY,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAEY,QAAA,SAAS,GAAG;IACvB,uDAAuD;IACvD,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,IAAI,CAAC,cAAc,EAAE;YAAE,OAAO;QAC9B,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,MAAM,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,uCAAuC;IACvC,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,MAAM,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,sCAAsC;IACtC,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,MAAM,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,8DAA8D;IAC9D,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,IAAI,CAAC,cAAc,EAAE;YAAE,OAAO;QAC9B,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,MAAM,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,+DAA+D;IAC/D,KAAK,CAAC,KAAa,EAAE,EAAc;QACjC,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;YAAC,EAAE,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QACxC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,CAAC,CAAC;QACpC,EAAE,EAAE,CAAC;QACL,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,OAAgB;QACvB,IAAI,CAAC;YACF,MAAc,CAAC,YAAY,GAAG,OAAO,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,uCAAuC;QACzC,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Input validation helpers.
3
+ *
4
+ * All functions throw a descriptive Error on invalid input so callers can
5
+ * surface actionable messages without catching generic exceptions.
6
+ */
7
+ import type { ChallengeAction } from "../types/liveness";
8
+ /** Returns true when s is a non-empty string after trimming. */
9
+ export declare function isNonEmpty(s: unknown): s is string;
10
+ /**
11
+ * Validates that apiKey looks like a SmartComply public key.
12
+ * Format: pk_live_<...> or pk_test_<...>
13
+ */
14
+ export declare function validateApiKey(apiKey: unknown): void;
15
+ /** Throws if clientId is not a valid UUID v4. */
16
+ export declare function validateClientId(clientId: unknown): void;
17
+ /** Throws if countryCode is not a 2-letter ISO 3166-1 alpha-2 code. */
18
+ export declare function validateCountryCode(countryCode: unknown): void;
19
+ /** Throws if the blob is empty or exceeds the given byte limit. */
20
+ export declare function validateFileSize(blob: Blob | File, maxBytes: number, label: string): void;
21
+ /** Throws if the blob's MIME type is not in the accepted image types list. */
22
+ export declare function validateImageType(blob: Blob | File, label: string): void;
23
+ /** Combined validation for a document image blob. */
24
+ export declare function validateDocumentBlob(blob: Blob | File): void;
25
+ /** Combined validation for a liveness video blob. */
26
+ export declare function validateVideoBlob(blob: Blob): void;
27
+ /** Combined validation for a snapshot / autoshot blob. */
28
+ export declare function validateSnapshotBlob(blob: Blob): void;
29
+ /** Throws if any entry in actions is not a backend-accepted challenge action. */
30
+ export declare function validateChallengeActions(actions: unknown[]): void;
31
+ /** Type-guard that narrows a string[] to ChallengeAction[]. */
32
+ export declare function toChallengeActions(actions: string[]): ChallengeAction[];
33
+ /** Throws if identifier is missing or too short to be plausible. */
34
+ export declare function validateIdentifier(identifier: unknown, minLength?: number): void;
35
+ //# sourceMappingURL=validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/utils/validator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAElD;AAID;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CASpD;AAOD,iDAAiD;AACjD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CASxD;AAMD,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAM9D;AAID,mEAAmE;AACnE,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,IAAI,CAUN;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAMxE;AAED,qDAAqD;AACrD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAG5D;AAED,qDAAqD;AACrD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAElD;AAED,0DAA0D;AAC1D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAErD;AAID,iFAAiF;AACjF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAWjE;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAGvE;AAID,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,SAAI,GAAG,IAAI,CAS3E"}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ /**
3
+ * Input validation helpers.
4
+ *
5
+ * All functions throw a descriptive Error on invalid input so callers can
6
+ * surface actionable messages without catching generic exceptions.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.isNonEmpty = isNonEmpty;
10
+ exports.validateApiKey = validateApiKey;
11
+ exports.validateClientId = validateClientId;
12
+ exports.validateCountryCode = validateCountryCode;
13
+ exports.validateFileSize = validateFileSize;
14
+ exports.validateImageType = validateImageType;
15
+ exports.validateDocumentBlob = validateDocumentBlob;
16
+ exports.validateVideoBlob = validateVideoBlob;
17
+ exports.validateSnapshotBlob = validateSnapshotBlob;
18
+ exports.validateChallengeActions = validateChallengeActions;
19
+ exports.toChallengeActions = toChallengeActions;
20
+ exports.validateIdentifier = validateIdentifier;
21
+ const constants_1 = require("./constants");
22
+ // ── String helpers ───────────────────────────────────────────────────────────
23
+ /** Returns true when s is a non-empty string after trimming. */
24
+ function isNonEmpty(s) {
25
+ return typeof s === "string" && s.trim().length > 0;
26
+ }
27
+ // ── API key ──────────────────────────────────────────────────────────────────
28
+ /**
29
+ * Validates that apiKey looks like a SmartComply public key.
30
+ * Format: pk_live_<...> or pk_test_<...>
31
+ */
32
+ function validateApiKey(apiKey) {
33
+ if (!isNonEmpty(apiKey)) {
34
+ throw new Error("SDK: apiKey is required.");
35
+ }
36
+ if (!/^pk_(live|test|sandbox)_/.test(apiKey)) {
37
+ throw new Error('SDK: apiKey must start with "pk_live_", "pk_test_" or "pk_sandbox_".');
38
+ }
39
+ }
40
+ // ── Client ID (UUID) ─────────────────────────────────────────────────────────
41
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
42
+ /** Throws if clientId is not a valid UUID v4. */
43
+ function validateClientId(clientId) {
44
+ if (!isNonEmpty(clientId)) {
45
+ throw new Error("SDK: clientId is required.");
46
+ }
47
+ if (!UUID_RE.test(clientId.trim())) {
48
+ throw new Error("SDK: clientId must be a valid UUID (e.g. a1b2c3d4-e5f6-7890-abcd-ef1234567890).");
49
+ }
50
+ }
51
+ // ── Country code ─────────────────────────────────────────────────────────────
52
+ const COUNTRY_CODE_RE = /^[A-Z]{2}$/;
53
+ /** Throws if countryCode is not a 2-letter ISO 3166-1 alpha-2 code. */
54
+ function validateCountryCode(countryCode) {
55
+ if (!isNonEmpty(countryCode) || !COUNTRY_CODE_RE.test(countryCode.trim())) {
56
+ throw new Error(`SDK: Invalid country code "${countryCode}". Expected a 2-letter ISO code (e.g. "NG", "GH").`);
57
+ }
58
+ }
59
+ // ── File / Blob ──────────────────────────────────────────────────────────────
60
+ /** Throws if the blob is empty or exceeds the given byte limit. */
61
+ function validateFileSize(blob, maxBytes, label) {
62
+ if (!blob || blob.size === 0) {
63
+ throw new Error(`SDK: ${label} is empty. Please capture or upload a valid file.`);
64
+ }
65
+ if (blob.size > maxBytes) {
66
+ const limitMB = (maxBytes / (1024 * 1024)).toFixed(0);
67
+ throw new Error(`SDK: ${label} exceeds the ${limitMB} MB limit (file is ${(blob.size / (1024 * 1024)).toFixed(1)} MB).`);
68
+ }
69
+ }
70
+ /** Throws if the blob's MIME type is not in the accepted image types list. */
71
+ function validateImageType(blob, label) {
72
+ if (blob.type && !constants_1.ACCEPTED_IMAGE_TYPES.includes(blob.type)) {
73
+ throw new Error(`SDK: ${label} must be a JPEG, PNG or WebP image (received "${blob.type}").`);
74
+ }
75
+ }
76
+ /** Combined validation for a document image blob. */
77
+ function validateDocumentBlob(blob) {
78
+ validateFileSize(blob, constants_1.MAX_DOCUMENT_BYTES, "Document image");
79
+ validateImageType(blob, "Document image");
80
+ }
81
+ /** Combined validation for a liveness video blob. */
82
+ function validateVideoBlob(blob) {
83
+ validateFileSize(blob, constants_1.MAX_VIDEO_BYTES, "Liveness video");
84
+ }
85
+ /** Combined validation for a snapshot / autoshot blob. */
86
+ function validateSnapshotBlob(blob) {
87
+ validateFileSize(blob, constants_1.MAX_SNAPSHOT_BYTES, "Snapshot");
88
+ }
89
+ // ── Challenge actions ─────────────────────────────────────────────────────────
90
+ /** Throws if any entry in actions is not a backend-accepted challenge action. */
91
+ function validateChallengeActions(actions) {
92
+ if (!Array.isArray(actions) || actions.length === 0) {
93
+ throw new Error("SDK: At least one challenge action is required.");
94
+ }
95
+ for (const a of actions) {
96
+ if (!constants_1.CHALLENGE_ACTIONS.includes(a)) {
97
+ throw new Error(`SDK: "${a}" is not a valid challenge action. Accepted: ${constants_1.CHALLENGE_ACTIONS.join(", ")}.`);
98
+ }
99
+ }
100
+ }
101
+ /** Type-guard that narrows a string[] to ChallengeAction[]. */
102
+ function toChallengeActions(actions) {
103
+ validateChallengeActions(actions);
104
+ return actions;
105
+ }
106
+ // ── Identifier / ID number ────────────────────────────────────────────────────
107
+ /** Throws if identifier is missing or too short to be plausible. */
108
+ function validateIdentifier(identifier, minLength = 3) {
109
+ if (!isNonEmpty(identifier)) {
110
+ throw new Error("SDK: identifier is required.");
111
+ }
112
+ if (identifier.trim().length < minLength) {
113
+ throw new Error(`SDK: identifier must be at least ${minLength} characters long.`);
114
+ }
115
+ }
116
+ //# sourceMappingURL=validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/utils/validator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAcH,gCAEC;AAQD,wCASC;AAQD,4CASC;AAOD,kDAMC;AAKD,4CAcC;AAGD,8CAMC;AAGD,oDAGC;AAGD,8CAEC;AAGD,oDAEC;AAKD,4DAWC;AAGD,gDAGC;AAKD,gDASC;AA7ID,2CAMqB;AAGrB,gFAAgF;AAEhF,gEAAgE;AAChE,SAAgB,UAAU,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACtD,CAAC;AAED,gFAAgF;AAEhF;;;GAGG;AACH,SAAgB,cAAc,CAAC,MAAe;IAC5C,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAgB,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,gFAAgF;AAEhF,MAAM,OAAO,GACX,iEAAiE,CAAC;AAEpE,iDAAiD;AACjD,SAAgB,gBAAgB,CAAC,QAAiB;IAChD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,C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C,CAAC;AAED,iFAAiF;AAEjF,oEAAoE;AACpE,SAAgB,kBAAkB,CAAC,UAAmB,EAAE,SAAS,GAAG,CAAC;IACnE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IACD,IAAK,UAAqB,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACb,oCAAoC,SAAS,mBAAmB,CACjE,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "smartcomply-web-sdk",
3
+ "version": "1.0.3",
4
+ "description": "Drop-in identity verification (KYC) widget for web apps — face liveness, NIN/BVN, document verification",
5
+ "main": "dist/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "browser": "dist/smartcomply.browser.js",
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "build:browser": "npx esbuild src/index.ts --bundle --format=iife --global-name=SmartComplySDK --outfile=dist/smartcomply.browser.js --target=es2020 --sourcemap",
17
+ "build:all": "npm run build && npm run build:browser",
18
+ "demo": "npm run build:all && node mock-api/index.js",
19
+ "prepublishOnly": "npm run build:all",
20
+ "typecheck": "tsc --noEmit"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/Anitajallas/smartcomply-web-sdk.git"
25
+ },
26
+ "keywords": [
27
+ "smartcomply",
28
+ "kyc",
29
+ "identity-verification",
30
+ "liveness",
31
+ "face-detection",
32
+ "onboarding",
33
+ "sdk",
34
+ "adhere",
35
+ "nin",
36
+ "bvn"
37
+ ],
38
+ "author": "SmartComply",
39
+ "license": "ISC",
40
+ "bugs": {
41
+ "url": "https://github.com/Anitajallas/smartcomply-web-sdk/issues"
42
+ },
43
+ "homepage": "https://github.com/Anitajallas/smartcomply-web-sdk#readme",
44
+ "devDependencies": {
45
+ "esbuild": "^0.28.0",
46
+ "typescript": "^5.9.3"
47
+ },
48
+ "dependencies": {
49
+ "@mediapipe/tasks-vision": "^0.10.32"
50
+ }
51
+ }