npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

biometry-react-components

v1.3.5

Published

React UI component library for capturing high-quality biometric data (voice, face, documents, video) to facilitate integration with 'Biometry' services

Readme

biometry-react-components

React UI component library with tools to work with camera and microphone for easier integration of Biometry services. This library could be used in combination with Biometry SDK

Installation

npm install biometry-react-components

Peer Dependencies

This library requires React 16.8.0 or higher (supports React Hooks):

{
  "peerDependencies": {
    "react": ">=16.8.0",
    "react-dom": ">=16.8.0"
  }
}

Components

DocScan

Captures ID documents, driver license and etc. Suitable component for Biometry's DocAuth.

import { DocScan } from 'biometry-react-components';

function DocumentCapture() {
  const handleConfirmCapture = (file: File) => {
    console.log('Confirmed captured document:', file);
    // Send file to your endpoint that will process DocAuth (we recommend this way, because you will not expose the API key on client side)
    // or
    // const response = await sdk.checkDocAuth(file, userFullName, { sessionId });
  };

  return <DocScan onConfirmCapture={handleConfirmCapture} />;
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | onConfirmCapture | (file: File) => void | required | Callback with captured image file. Triggered when the user confirms the captured image/document | | onCapture | (file: File) => void | optional | Callback with captured image file. Triggered automatically when image/document capture finishes. | | rectWidth | number | 640 | Width of camera area | | rectHeight | number | 400 | Height of camera area | | className | string | - | Custom CSS class | | style | React.CSSProperties | - | Custom inline styles | | noShadow | boolean | false | Remove shadow and border radius |

FaceCapture

Captures facial images with an oval guidance overlay. Ideal for Face Match and Face Enrollment.

import { FaceCapture } from 'biometry-react-components';

function FaceCapture() {
  const handleConfirmCapture = (file: File) => {
    console.log('Confirmed captured face:', file);
    // const response = await sdk.enrollFace(file, 'John Doe');
  };

  return <FaceCapture onConfirmCapture={handleConfirmCapture} />;
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | onConfirmCapture | (file: File) => void | required | Callback with captured image file. Triggered when the user confirms the captured image | | onCapture | (file: File) => void | optional | Callback with captured image file. Triggered automatically when user captures the image. | | rectWidth | number | 360 | Width of camera area | | rectHeight | number | 576 | Height of camera area | | className | string | - | Custom CSS class | | style | React.CSSProperties | - | Custom inline styles | | noShadow | boolean | false | Remove shadow and border radius |

FaceRecorder

Records video with facial guidance overlay and displays 10 random numbers (0-9) for the user to read aloud. Automatically extracts audio from the recorded video. This component could be used for Process Video and Voice Enrollment

import { FaceRecorder } from 'biometry-react-components';

function FaceRecorder() {
  const handleConfirm = (video: File, audio: File, phrase: string) => {
    console.log('Confirmed video:', video);
    console.log('Confirmed audio:', audio);
    console.log('Phrase:', phrase);
    // Send files to your endpoint that will process the biometric data
    // const response = await sdk.processVideo(video, phrase, userFullName);
    // or
    // const voiceResponse = await sdk.enrollVoice(audio, userFullName);
  };

  return <FaceRecorder onConfirmRecording={handleConfirm} />;
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | onConfirmRecording | (video: File, audio: File, phrase: string) => void | required | Triggered when the user confirms they want to use the recorded video. Provides both media files and the spoken phrase. | | onRecorded | (video: File, audio: File, phrase: string) => void | optional | Triggered automatically right after recording finishes. Useful for pre-uploading or background processing. | | rectWidth | number | 360 | Width of camera area | | rectHeight | number | 576 | Height of camera area | | className | string | - | Custom CSS class | | style | React.CSSProperties | - | Custom inline styles | | noShadow | boolean | false | Remove shadow and border radius |

VoiceRecorder

Records audio with real-time waveform visualization and adaptive quality settings. Use this for Voice Enrollment

import { VoiceRecorder } from 'biometry-react-components';

function VoiceRecorder() {
  const handleConfirm = (file: File, phrase: string) => {
    console.log('Confirmed audio:', file);
    console.log('Phrase:', phrase);
    // const response = await sdk.enrollVoice(file, 'John Doe');
  };

  return <VoiceRecorder onConfirmRecording={handleConfirm} />;
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | onConfirmRecording | (file: File, phrase: string) => void | required | Callback with captured audio file and phrase. Triggered when the user confirms the recorded media | | onRecorded | (file: File, phrase: string) => void | optional | Callback with captured audio file and phrase. Triggered automatically when recording finishes | | rectWidth | number | 360 | Width of component area | | rectHeight | number | undefined | Height of component area (optional) | | className | string | - | Custom CSS class | | style | React.CSSProperties | - | Custom inline styles | | noShadow | boolean | false | Remove shadow and border radius |

Custom Hooks

useRecorder

A powerful hook for recording audio and video with adaptive quality settings and automatic format detection.

import { useRecorder } from 'biometry-react-components';

function CustomRecorder() {
  const mediaStream = // ... your media stream
  
  const { 
    isRecording, 
    startRecording, 
    stopRecording, 
    cancelRecording 
  } = useRecorder(mediaStream, "video", (blob) => {
    console.log('Recording completed:', blob);
  });

  return (
    ...
  );
}

Parameters

| Parameter | Type | Description | |-----------|------|-------------| | stream | MediaStream \| null | Media stream to record from | | type | "audio" \| "video" | Type of media to record | | onStopRecording | (blob: Blob) => void | Callback when recording stops |

Returns

| Property | Type | Description | |----------|------|-------------| | isRecording | boolean | Current recording state | | startRecording | () => void | Start recording function | | stopRecording | () => void | Stop recording function | | cancelRecording | () => void | Cancel recording function |

usePermissions

Hook for managing camera and microphone permissions with adaptive quality constraints.

import usePermissions from 'biometry-react-components';

function PermissionManager() {
  const { 
    permission, 
    stream, 
    stopStreamTracks, 
    requestPermissions, 
    isLoading 
  } = usePermissions({ rectWidth: 1280, rectHeight: 720 });

  if (isLoading) return <div>Loading...</div>;
  
  if (!permission) {
    return <button onClick={requestPermissions}>Grant Permissions</button>;
  }

  return <div>Camera and microphone access granted!</div>;
}

Parameters

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | rectWidth | number | 1920 | Desired video width | | rectHeight | number | 1080 | Desired video height |

Returns

| Property | Type | Description | |----------|------|-------------| | permission | boolean | Permission granted status | | stream | MediaStream \| null | Active media stream | | stopStreamTracks | () => void | Stop all media tracks | | requestPermissions | () => Promise<void> | Request camera/microphone permissions | | isLoading | boolean | Loading state during permission request |

useAudioPermissions

Specialized hook for audio-only permissions with optimized audio constraints.

import useAudioPermissions from 'biometry-react-components';

function AudioPermissionManager() {
  const { 
    permission, 
    stream, 
    stopStreamTracks, 
    requestPermissions, 
    isLoading 
  } = useAudioPermissions();

  if (isLoading) return <div>Loading...</div>;
  
  if (!permission) {
    return <button onClick={requestPermissions}>Grant Microphone Access</button>;
  }

  return <div>Microphone access granted!</div>;
}

Returns

| Property | Type | Description | |----------|------|-------------| | permission | boolean | Audio permission granted status | | stream | MediaStream \| null | Active audio stream | | stopStreamTracks | () => void | Stop all audio tracks | | requestPermissions | () => Promise<void> | Request microphone permissions | | isLoading | boolean | Loading state during permission request |

License

MIT License - see the LICENSE file for details.