@microblink/biometrics 1000.0.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/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@microblink/biometrics",
3
+ "version": "1000.0.0",
4
+ "author": "Microblink",
5
+ "type": "module",
6
+ "main": "./dist/biometrics.js",
7
+ "module": "./dist/biometrics.js",
8
+ "description": "Biometrics browser SDK for guided and headless face capture.",
9
+ "keywords": [],
10
+ "files": [
11
+ "dist",
12
+ "types"
13
+ ],
14
+ "peerDependencies": {
15
+ "@ark-ui/solid": "^5.38.1",
16
+ "solid-js": "^1.9.14",
17
+ "solid-zustand": "^2.0.0"
18
+ },
19
+ "dependencies": {
20
+ "@microblink/biometrics-core": "1000.0.0",
21
+ "@microblink/biometrics-ux-manager": "1000.0.0",
22
+ "@microblink/camera-manager": "^8.1.0"
23
+ },
24
+ "access": "public",
25
+ "types": "./types/index.rollup.d.ts",
26
+ "homepage": "https://github.com/microblink/web-sdks",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/microblink/web-sdks.git"
30
+ },
31
+ "exports": {
32
+ ".": {
33
+ "types": "./types/index.rollup.d.ts",
34
+ "import": "./dist/biometrics.js"
35
+ },
36
+ "./package.json": "./package.json"
37
+ }
38
+ }
@@ -0,0 +1,376 @@
1
+ import { BiometricsDiagnosticCallback, BiometricsDiagnosticCallback as BiometricsDiagnosticCallback$1, BiometricsDiagnosticComponent, BiometricsDiagnosticEvent, BiometricsDiagnosticPhase, BiometricsDiagnosticResource, BiometricsDiagnosticStatus, BiometricsError, BiometricsError as BiometricsError$1, BiometricsErrorCode, BiometricsErrorComponent, BiometricsErrorOptions, BiometricsErrorStage, BiometricsFace, BiometricsResourceKind, BiometricsResourceKind as CaptureBiometricsResourceKind, BiometricsSupportCheck, BiometricsSupportCheckId, BiometricsSupportCheckStatus, BiometricsSupportReport, BrowserStorageSupport, CaptureFaceConfig, CaptureFaceConfig as CaptureFaceConfig$1, CaptureFrame, CaptureLogLevel, CaptureSessionState, CaptureSignature, CapturedImage, CheckBiometricsSupportOptions, ConfigurationError, DerivedDeviceInfo, DeviceInfo, DeviceScreenInfo, FaceAnalysisSessionSettings, FaceCaptureResult, FaceCaptureResult as FaceCaptureResult$1, FaceLandmarks, FaceLandmarks as FaceLandmarks$1, FormFactor, GpuInfo, ImageOrigin, LicenseError, LivenessFrame, LivenessFrameQuality, PermissionError, SessionError, UADataValues, UnifiedFeedback, UnifiedFeedback as UnifiedFeedback$1, WasmVariant, WasmVariant as WasmVariant$1, checkBiometricsSupport, createDerivedDeviceInfo, getBiometricsFaceFromCaptureResult, getDeviceInfo, getUserAgentData, isFaceCaptureResult, normalizeBiometricsError } from "@microblink/biometrics-core";
2
+ import { FeedbackUiOptions, LocaleRecord, LocalizationStrings, PartialLocalizationStrings } from "@microblink/biometrics-ux-manager/ui";
3
+ import { CameraManagerUiOptions } from "@microblink/camera-manager/ui";
4
+ //#region ../analytics/types/ping/ping.browser.device.info.d.ts
5
+ type PingBrowserDeviceInfoData = {
6
+ userAgentData?: UserAgentData;
7
+ userAgent: string;
8
+ threads: number;
9
+ memory?: number;
10
+ gpu?: Gpu;
11
+ screen: Screen;
12
+ browserStorageSupport: BrowserStorageSupport$1;
13
+ derivedDeviceInfo: DerivedDeviceInfo$1;
14
+ };
15
+ type UserAgentData = {
16
+ brands?: BrandsItem[];
17
+ mobile?: boolean;
18
+ platform?: string;
19
+ architecture?: string;
20
+ bitness?: string;
21
+ formFactors?: FormFactorsItem[];
22
+ model?: string;
23
+ platformVersion?: string;
24
+ fullVersionList?: FullVersionListItem[];
25
+ wow64?: boolean;
26
+ };
27
+ type Gpu = {
28
+ renderer: string;
29
+ shadingLanguageVersion: string;
30
+ vendor: string;
31
+ version: string;
32
+ };
33
+ type Screen = {
34
+ screenWidth: number;
35
+ screenHeight: number;
36
+ devicePixelRatio: number;
37
+ physicalScreenWidth: number;
38
+ physicalScreenHeight: number;
39
+ maxTouchPoints: number;
40
+ };
41
+ type BrowserStorageSupport$1 = {
42
+ cookieEnabled: boolean;
43
+ localStorageEnabled: boolean;
44
+ };
45
+ type DerivedDeviceInfo$1 = {
46
+ model: string;
47
+ formFactors: FormFactorsItem[];
48
+ platform: string;
49
+ browser: Browser;
50
+ };
51
+ type BrandsItem = {
52
+ brand: string;
53
+ version: string;
54
+ };
55
+ type FullVersionListItem = {
56
+ brand: string;
57
+ version: string;
58
+ };
59
+ type Browser = {
60
+ brand: string;
61
+ version: string;
62
+ };
63
+ type FormFactorsItem = "Desktop" | "Automotive" | "Mobile" | "Tablet" | "XR" | "EInk" | "Watch";
64
+ /** Ping type for ping.browser.device.info */
65
+ type PingBrowserDeviceInfo = PingBase<"ping.browser.device.info", "1.0.0", PingBrowserDeviceInfoData>;
66
+ //#endregion
67
+ //#region ../analytics/types/ping/ping.error.d.ts
68
+ type PingErrorData = {
69
+ errorType: ErrorType;
70
+ errorMessage: string;
71
+ stackTrace?: string;
72
+ };
73
+ type ErrorType = "NonFatal" | "Crash";
74
+ /** Ping type for ping.error */
75
+ type PingError = PingBase<"ping.error", "1.0.0", PingErrorData>;
76
+ //#endregion
77
+ //#region ../analytics/types/ping/ping.hardware.camera.info.d.ts
78
+ type PingCameraHardwareInfoData = {
79
+ availableCameras: AvailableCamerasItem[];
80
+ };
81
+ type AvailableCamerasItem = {
82
+ deviceId: string;
83
+ cameraFacing: CameraFacing$1;
84
+ focus?: Focus;
85
+ availableResolutions?: AvailableResolutionsItem[];
86
+ };
87
+ type AvailableResolutionsItem = {
88
+ width: number;
89
+ height: number;
90
+ };
91
+ type CameraFacing$1 = "Front" | "Back" | "Unknown";
92
+ type Focus = "Auto" | "Fixed";
93
+ /** Ping type for ping.hardware.camera.info */
94
+ type PingCameraHardwareInfo = PingBase<"ping.hardware.camera.info", "1.0.3", PingCameraHardwareInfoData>;
95
+ //#endregion
96
+ //#region ../analytics/types/ping/ping.log.d.ts
97
+ type PingLogData = {
98
+ logLevel: LogLevel;
99
+ logMessage: string;
100
+ };
101
+ type LogLevel = "Info" | "Warning";
102
+ /** Ping type for ping.log */
103
+ type PingLog = PingBase<"ping.log", "1.0.0", PingLogData>;
104
+ //#endregion
105
+ //#region ../analytics/types/ping/ping.sdk.camera.input.info.d.ts
106
+ type PingCameraInputInfoData = {
107
+ deviceId: string;
108
+ cameraFacing: CameraFacing;
109
+ cameraFrameWidth: number;
110
+ cameraFrameHeight: number;
111
+ roiWidth: number;
112
+ roiHeight: number;
113
+ viewPortAspectRatio: number;
114
+ };
115
+ type CameraFacing = "Front" | "Back" | "Unknown";
116
+ /** Ping type for ping.sdk.camera.input.info */
117
+ type PingCameraInputInfo = PingBase<"ping.sdk.camera.input.info", "1.0.2", PingCameraInputInfoData>;
118
+ //#endregion
119
+ //#region ../analytics/types/ping/ping.sdk.camera.permission.d.ts
120
+ type PingCameraPermissionData = {
121
+ eventType: EventType$2;
122
+ cameraPermissionGranted?: boolean;
123
+ };
124
+ type EventType$2 = "CameraPermissionCheck" | "CameraPermissionRequest" | "CameraPermissionUserResponse";
125
+ /** Ping type for ping.sdk.camera.permission */
126
+ type PingCameraPermission = PingBase<"ping.sdk.camera.permission", "1.0.0", PingCameraPermissionData>;
127
+ //#endregion
128
+ //#region ../analytics/types/ping/ping.sdk.init.start.d.ts
129
+ type PingSdkInitStartData = {
130
+ product: Product;
131
+ platform: Platform;
132
+ platformDetails?: PlatformDetails;
133
+ packageName: string;
134
+ userId: string;
135
+ pingProxyEnabled: boolean;
136
+ baltazarProxyEnabled: boolean;
137
+ };
138
+ type Product = "BlinkCard" | "BlinkID" | "BlinkInput" | "Capture" | "DocumentVerification" | "Pdf417Mobi" | "PhotoPay" | "Biometrics";
139
+ type Platform = "iOS" | "Android" | "Emscripten" | "MacOS" | "Linux" | "Windows";
140
+ type PlatformDetails = "simd" | "simd-threads" | "simd-relaxed" | "simd-relaxed-threads" | "lightweight-simd" | "lightweight-simd-threads" | "lightweight-simd-relaxed" | "lightweight-simd-relaxed-threads";
141
+ /** Ping type for ping.sdk.init.start */
142
+ type PingSdkInitStart = PingBase<"ping.sdk.init.start", "3.0.0", PingSdkInitStartData>;
143
+ //#endregion
144
+ //#region ../analytics/types/ping/ping.sdk.scan.conditions.d.ts
145
+ type PingScanningConditionsData = {
146
+ updateType: UpdateType;
147
+ deviceOrientation?: DeviceOrientation;
148
+ flashlightOn?: boolean;
149
+ };
150
+ type UpdateType = "DeviceOrientation" | "FlashlightState";
151
+ type DeviceOrientation = "Portrait" | "LandscapeRight" | "LandscapeLeft" | "PortraitUpside";
152
+ /** Ping type for ping.sdk.scan.conditions */
153
+ type PingScanningConditions = PingBase<"ping.sdk.scan.conditions", "1.0.0", PingScanningConditionsData>;
154
+ //#endregion
155
+ //#region ../analytics/types/ping/ping.sdk.upload.d.ts
156
+ type PingUploadData = {
157
+ sessionId: string;
158
+ eventType: EventType$1;
159
+ durationMs?: number;
160
+ payloadBytes?: number;
161
+ errorCategory?: string;
162
+ retryCount?: number;
163
+ };
164
+ type EventType$1 = "Initialized" | "Completed" | "Failed" | "RetryInitialized" | "Cancelled";
165
+ /** Ping type for ping.sdk.upload */
166
+ type PingUpload = PingBase<"ping.sdk.upload", "1.0.0", PingUploadData>;
167
+ //#endregion
168
+ //#region ../analytics/types/ping/ping.sdk.ux.event.d.ts
169
+ type PingUxEventData = {
170
+ eventType: EventType;
171
+ errorMessageType?: ErrorMessageType;
172
+ alertType?: AlertType;
173
+ helpCloseType?: HelpCloseType;
174
+ cameraFailureCategory?: string;
175
+ closeReason?: CloseReason;
176
+ };
177
+ type EventType = "CameraStarted" | "CameraClosed" | "OnboardingInfoDisplayed" | "CloseButtonClicked" | "HelpTooltipDisplayed" | "HelpOpened" | "HelpClosed" | "AlertDisplayed" | "ErrorMessage" | "StepTimeout" | "AppMovedToBackground" | "InactivityTimeout" | "UnsupportedBarcodeTimeout" | "CameraOpenFailed" | "FaceCaptureScreenDisplayed";
178
+ type ErrorMessageType = "MoveCloser" | "MoveFarther" | "KeepVisible" | "FlipSide" | "AlignDocument" | "MoveFromEdge" | "IncreaseLighting" | "DecreaseLighting" | "EliminateBlur" | "EliminateGlare";
179
+ type AlertType = "InvalidLicenseKey" | "NetworkError" | "DocumentClassNotAllowed" | "StepTimeout" | "DocumentNotSupported" | "InactivityTimeout" | "UnsupportedBarcodeTimeout";
180
+ type HelpCloseType = "ContentSkipped" | "ContentFullyViewed";
181
+ type CloseReason = "User" | "Sdk" | "SystemError";
182
+ /** Ping type for ping.sdk.ux.event */
183
+ type PingUxEvent = PingBase<"ping.sdk.ux.event", "1.3.0", PingUxEventData>;
184
+ //#endregion
185
+ //#region ../analytics/types/ping/ping.sdk.wrapper.product.d.ts
186
+ type PingWrapperProductInfoData = {
187
+ wrapperProduct: WrapperProduct;
188
+ correlationId?: string;
189
+ };
190
+ type WrapperProduct = "CrossplatformFlutter" | "CrossplatformReactNative" | "IdentityVerification";
191
+ /** Ping type for ping.sdk.wrapper.product */
192
+ type PingWrapperProductInfo = PingBase<"ping.sdk.wrapper.product", "1.0.0", PingWrapperProductInfoData>;
193
+ //#endregion
194
+ //#region ../analytics/types/ping/Ping.d.ts
195
+ type Ping = PingBrowserDeviceInfo | PingError | PingCameraHardwareInfo | PingLog | PingCameraInputInfo | PingCameraPermission | PingSdkInitStart | PingScanningConditions | PingUpload | PingUxEvent | PingWrapperProductInfo;
196
+ type SchemaName = Ping["schemaName"];
197
+ //#endregion
198
+ //#region ../analytics/types/ping/ping.base.d.ts
199
+ type Semver = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`;
200
+ /** Generated base structure for a ping event. */
201
+ interface PingBase<TSchemaName extends SchemaName, TSchemaVersion extends Semver = "1.0.0", TData extends object = {}, TSessionNumber extends number = number> {
202
+ schemaName: TSchemaName;
203
+ schemaVersion: TSchemaVersion;
204
+ data: TData;
205
+ sessionNumber?: TSessionNumber;
206
+ }
207
+ //#endregion
208
+ //#region types/types.d.ts
209
+ type BiometricsCaptureSettings = {
210
+ imageOrigin?: ImageOrigin;
211
+ logLevel?: CaptureLogLevel;
212
+ faceAnalysis?: FaceAnalysisSessionSettings;
213
+ };
214
+ type BiometricsAnalyticsSettings = {
215
+ enabled?: boolean;
216
+ pingProxyUrl?: string;
217
+ userId?: string;
218
+ };
219
+ /** Progress reported while SDK resources are downloaded. */
220
+ type DownloadProgress = {
221
+ loaded: number;
222
+ contentLength: number;
223
+ progress: number;
224
+ finished: boolean;
225
+ };
226
+ type ProgressStatusCallback = (progress: DownloadProgress) => void;
227
+ type BiometricsAnalyticsEvent = Ping extends (infer Event) ? Event extends {
228
+ sessionNumber?: number;
229
+ } ? Omit<Event, "sessionNumber"> : never : never;
230
+ /** Session-scoped access to the native analytics transport. */
231
+ type BiometricsSessionContext = {
232
+ readonly sessionId: string;
233
+ readonly traceId: string;
234
+ readonly sessionNumber: number;
235
+ report(event: BiometricsAnalyticsEvent): Promise<void>;
236
+ flush(): Promise<void>;
237
+ };
238
+ /** Root SDK settings for face capture. */
239
+ type BiometricsSettings = {
240
+ licenseKey: string;
241
+ resourcesLocation?: string;
242
+ /** WebAssembly module variant to use. Defaults to automatic feature detection. */
243
+ wasmVariant?: WasmVariant$1;
244
+ /** Maximum initialization duration in milliseconds. @default 60000 */
245
+ initializationTimeoutMs?: number;
246
+ capture?: BiometricsCaptureSettings;
247
+ analytics?: BiometricsAnalyticsSettings;
248
+ onDiagnostic?: BiometricsDiagnosticCallback$1;
249
+ /** Optional callback for WASM and data-file download progress. */
250
+ onDownloadProgress?: ProgressStatusCallback;
251
+ };
252
+ /** Per-session face capture options. */
253
+ type BiometricsSessionConfig = {
254
+ /** Capture timeout in milliseconds. Set to `null` to disable. @default 60000 */
255
+ captureTimeoutMs?: number | null;
256
+ /** Additional capture session and attempt options. */
257
+ captureFace?: Omit<CaptureFaceConfig$1, "timeoutMs" | "onFeedbackChange" | "onStateChange" | "onCapture" | "onTimeout" | "onError" | "onAnalysisResult"> & {
258
+ /** Native quality thresholds fixed for this session and reused by every capture attempt. */
259
+ thresholds?: FaceAnalysisSessionSettings;
260
+ };
261
+ };
262
+ /** Events surfaced by {@link BiometricsSession}. */
263
+ type BiometricsSessionEvent = {
264
+ kind: "faceGuidance";
265
+ feedback: UnifiedFeedback$1;
266
+ } | {
267
+ kind: "captureTechnicalData";
268
+ data: CaptureTechnicalData;
269
+ } | {
270
+ kind: "captureFinished";
271
+ result: FaceCaptureResult$1;
272
+ } | {
273
+ kind: "captureTimeout";
274
+ };
275
+ type BiometricsUiEvent = BiometricsSessionEvent | {
276
+ kind: "ux";
277
+ name: "onboardingShown" | "onboardingClosed" | "helpOpened" | "helpClosed";
278
+ };
279
+ type CaptureTechnicalData = {
280
+ normalizedFaceBounds?: {
281
+ x: number;
282
+ y: number;
283
+ width: number;
284
+ height: number;
285
+ };
286
+ landmarks?: FaceLandmarks$1;
287
+ inputImageSize?: {
288
+ width: number;
289
+ height: number;
290
+ };
291
+ frameNumber?: number;
292
+ };
293
+ type BiometricsSessionState = {
294
+ phase: "idle";
295
+ } | {
296
+ phase: "capturing";
297
+ capture: {
298
+ sessionState: CaptureSessionState;
299
+ feedback: UnifiedFeedback$1;
300
+ technicalData?: CaptureTechnicalData;
301
+ };
302
+ } | {
303
+ phase: "failed";
304
+ stage: "capture";
305
+ error: BiometricsError$1;
306
+ } | {
307
+ phase: "succeeded";
308
+ result: FaceCaptureResult$1;
309
+ } | {
310
+ phase: "finished";
311
+ };
312
+ /** Headless session for one face capture. */
313
+ type BiometricsSession = {
314
+ getState(): BiometricsSessionState;
315
+ subscribe(listener: (state: BiometricsSessionState) => void): () => void;
316
+ /** Feed camera frames while {@link BiometricsSession.run} is in progress. */
317
+ processFrame(imageData: ImageData): Promise<ArrayBuffer>;
318
+ /** Set the camera source used by subsequent capture attempts. */
319
+ setCameraSource(videoElement: HTMLVideoElement | undefined, track: MediaStreamTrack | undefined): void;
320
+ /** Pauses or resumes the active capture attempt's timeout. */
321
+ setCaptureTimeoutPaused(paused: boolean): void;
322
+ /** Starts face capture. */
323
+ run(): Promise<FaceCaptureResult$1>;
324
+ retry(): Promise<FaceCaptureResult$1>;
325
+ onEvent(listener: (event: BiometricsSessionEvent) => void): () => void;
326
+ onError(listener: (error: BiometricsError$1) => void): () => void;
327
+ onDiagnostic(listener: BiometricsDiagnosticCallback$1): () => void;
328
+ getSessionContext(): Promise<BiometricsSessionContext>;
329
+ finish(): void;
330
+ };
331
+ /** Initialized Biometrics capture SDK instance. */
332
+ type BiometricsSdk = {
333
+ /** Creates a face capture session. */
334
+ startSession(config?: BiometricsSessionConfig): BiometricsSession;
335
+ close(): Promise<void>;
336
+ };
337
+ type BiometricsFeedbackUiOptions = Pick<FeedbackUiOptions, "localizationStrings" | "showHelpButton"> & {
338
+ showOnboardingGuide?: boolean;
339
+ helpTooltipShowDelay?: number | null;
340
+ };
341
+ type BiometricsUiOptions = {
342
+ licenseKey: string;
343
+ targetNode?: HTMLElement;
344
+ cameraManagerUiOptions?: Partial<CameraManagerUiOptions>;
345
+ preferredCameraDeviceId?: string;
346
+ /** Called whenever the selected camera changes. */
347
+ onSelectedCameraDeviceIdChange?: (deviceId: string | undefined) => void;
348
+ resourcesLocation?: string;
349
+ /** WebAssembly module variant to use. Defaults to automatic feature detection. */
350
+ wasmVariant?: WasmVariant$1;
351
+ /** Maximum SDK initialization duration in milliseconds. @default 60000 */
352
+ initializationTimeoutMs?: number;
353
+ capture?: BiometricsCaptureSettings;
354
+ analytics?: BiometricsAnalyticsSettings;
355
+ /** Capture timeout in milliseconds. Set to `null` to disable. @default 60000 */
356
+ captureTimeoutMs?: number | null;
357
+ captureFace?: BiometricsSessionConfig["captureFace"];
358
+ feedbackUiOptions?: BiometricsFeedbackUiOptions;
359
+ onEvent?: (event: BiometricsUiEvent) => void;
360
+ onResult?: (result: FaceCaptureResult$1) => void;
361
+ onError?: (error: BiometricsError$1) => void;
362
+ onDiagnostic?: BiometricsDiagnosticCallback$1;
363
+ };
364
+ type BiometricsUi = {
365
+ destroy(): Promise<void>;
366
+ };
367
+ //#endregion
368
+ //#region types/createBiometrics.d.ts
369
+ export declare function createBiometrics(settings: BiometricsSettings): Promise<BiometricsSdk>;
370
+ //#endregion
371
+ //#region types/createBiometricsUi.d.ts
372
+ export declare function createBiometricsUi(options: BiometricsUiOptions): Promise<BiometricsUi>;
373
+ //#endregion
374
+ export { type BiometricsAnalyticsEvent, type BiometricsAnalyticsSettings, type BiometricsCaptureSettings, type BiometricsDiagnosticCallback, type BiometricsDiagnosticComponent, type BiometricsDiagnosticEvent, type BiometricsDiagnosticPhase, type BiometricsDiagnosticResource, type BiometricsDiagnosticStatus, BiometricsError, type BiometricsErrorCode, type BiometricsErrorComponent, type BiometricsErrorOptions, type BiometricsErrorStage, type BiometricsFace, type BiometricsFeedbackUiOptions, type BiometricsResourceKind, type BiometricsSdk, type BiometricsSession, type BiometricsSessionConfig, type BiometricsSessionContext, type BiometricsSessionEvent, type BiometricsSessionState, type BiometricsSettings, type BiometricsSupportCheck, type BiometricsSupportCheckId, type BiometricsSupportCheckStatus, type BiometricsSupportReport, type BiometricsUi, type BiometricsUiEvent, type BiometricsUiOptions, type BrowserStorageSupport, type CaptureBiometricsResourceKind, type CaptureFaceConfig, type CaptureFrame, type CaptureSignature, type CaptureTechnicalData, type CapturedImage, type CheckBiometricsSupportOptions, ConfigurationError, type DerivedDeviceInfo, type DeviceInfo, type DeviceScreenInfo, type DownloadProgress, type FaceCaptureResult, type FaceLandmarks, type FormFactor, type GpuInfo, LicenseError, type LivenessFrame, type LivenessFrameQuality, type LocaleRecord, type LocalizationStrings, type PartialLocalizationStrings, PermissionError, type ProgressStatusCallback, SessionError, type UADataValues, type UnifiedFeedback, type WasmVariant, checkBiometricsSupport, createDerivedDeviceInfo, getBiometricsFaceFromCaptureResult, getDeviceInfo, getUserAgentData, isFaceCaptureResult, normalizeBiometricsError };
375
+
376
+ export {};