Biometrics Module

The Biometrics Module enables selfie/video capture and comparison against previously captured ID documents. It automatically integrates with your configured Biometrics provider (Onfido or Incode)

Quick Implementation

1

Add HTML Element

First, add a container element to your HTML:

1<div id="biometrics"></div>
2

Initialize Module

Create and mount the biometrics component:

1const biometrics = oneSdk.component("biometrics");
2biometrics.mount("#biometrics");
3

Handle Events

Set up event listeners for biometric operations:

1biometrics.on("detection_complete", (event) => {
2 console.log("Biometric capture completed");
3});
4
5biometrics.on("results", (results) => {
6 console.log("Verification results:", results);
7});

Provider-Specific Implementation

Implementation Flow
  1. Mount component
  2. User clicks “Upload Recording”
  3. Receive detection_complete event
  4. Background processing begins
  5. Receive results event
Example Usage
1const biometrics = oneSdk.component('biometrics');
2
3// Mount component
4biometrics.mount("#biometrics");
5
6// Handle recording upload
7biometrics.on('detection_complete', (event) => {
8 console.log('Recording uploaded');
9});

Biometrics Events

Implementation Best Practices

Mobile Optimization
1<meta
2 name="viewport"
3 content="width=device-width, initial-scale=1.0"
4 charset="UTF-8"
5/>

Ensure proper viewport settings for mobile devices.

Error Handling
1biometrics.on('error', (error) => {
2 console.error('Biometrics error:', error);
3 // Implement user-friendly error handling
4});
Testing Tip

During development, test with both providers (if applicable) to ensure consistent behavior across different biometric implementations.

For detailed event documentation and advanced configurations, refer to the complete Biometrics Event Reference.

Built with