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

@ngmthaq20/react-face-id-capture

v1.0.25

Published

React component for face registration with real-time face detection and multi-angle capture

Readme

@ngmthaq20/react-face-id-capture

React component for face registration with real-time face detection and multi-angle capture. The user slowly rolls their head in a circle while the camera records; the motion is post-processed to automatically select the best frame for each of 6 face angles (center, top, top-left, top-right, left, right) using AI-powered face detection.

Installation

yarn add @ngmthaq20/react-face-id-capture

Peer Dependencies

yarn add react react-dom

Quick Start

import { FaceRegister } from "@ngmthaq20/react-face-id-capture";

function App() {
  return (
    <FaceRegister
      locale="en"
      onComplete={(captures) => {
        // captures: array of up to 6 face images
        captures.forEach((c) => {
          console.log(c.step); // "center" | "top" | "topLeft" | "topRight" | "left" | "right"
          console.log(c.labelKey); // translation key for the step label
          console.log(c.data); // base64 JPEG data URL
        });
      }}
      onExit={() => {
        // Called when the user backs out of the intro/result screen
        console.log("User exited");
      }}
    />
  );
}

By default the component drops the user straight into the capture screen and fires onComplete as soon as processing finishes — no intro or result screen. Opt into those screens with showIntroScreen and showResultScreen:

<FaceRegister
  locale="en"
  showIntroScreen
  showResultScreen
  onComplete={handleComplete}
  onExit={handleExit}
/>

Props

| Prop | Type | Default | Description | | ------------------ | ------------------------------- | ------- | --------------------------------------------------------------------------------------- | | onComplete | (captures: Capture[]) => void | — | Called with the selected face images (after processing, or after "Save & Continue") | | onExit | () => void | — | Called when the user backs out of the intro screen or "Discard & Exit" on the result | | locale | string | — | Required. Active language ("en", "ja", or custom — falls back to "en" if unknown) | | translations | FaceRegisterTranslations | — | Override or extend translation strings | | showIntroScreen | boolean | false | Show the instructional intro screen before the camera starts | | showResultScreen | boolean | false | Show the captured-images review screen before completing |

Capture Object

interface Capture {
  step: "center" | "top" | "topLeft" | "topRight" | "left" | "right";
  labelKey: string; // translation key for the step label (e.g. "faceRegister.labelCenter")
  data: string; // base64 JPEG data URL
}

How It Works

  1. Intro Screen (optional — showIntroScreen) — Instructions with a "Get Started" button.
  2. Capture Screen — Camera feed with a circular overlay and a progress ring. The user slowly rolls their head in a circle. The component detects the face in real-time, fills ring ticks as each head angle is swept through, and records the motion. When coverage is complete the ring locks green and recording stops automatically.
  3. Processing Screen — The recorded motion is sampled into frames and scored against each target pose to pick the best image per angle. If coverage was incomplete, a retry prompt asks the user to sweep more slowly.
  4. Result Screen (optional — showResultScreen) — Displays the captured images with "Save & Continue", "Register Again", and "Discard & Exit" options.

When showResultScreen is false, onComplete fires automatically once processing succeeds.

Translations

Built-in languages: English (en) and Japanese (ja). The library ships its own lightweight translation layer — no i18next or other i18n peer dependency is required.

Change language

<FaceRegister locale="ja" onComplete={handleComplete} />

Override specific strings

<FaceRegister
  translations={{
    introTitle: "Verify Your Identity",
    getStarted: "Begin Scan",
    save: "Confirm & Continue",
  }}
  onComplete={handleComplete}
/>

Add a custom language

<FaceRegister
  locale="ko"
  translations={{
    introTitle: "얼굴 등록",
    introSub: "본인 확인을 위해 얼굴 프로필을 설정합니다",
    getStarted: "시작하기",
    // ... other keys
  }}
  onComplete={handleComplete}
/>

All Translation Keys

| Key | Default (EN) | | ---------------------- | -------------------------------------------------------------------------------------------- | | introTitle | Face Registration | | introSub | Set up your face profile for identification | | introStep1 | Position your face within the circle | | introStep2 | Slowly roll your head in a circle | | introStep3 | Hold steady while we capture each angle | | getStarted | Get Started | | back | Back | | hudTitle | Face Registration | | hudProgress | {{current}} / {{total}} | | recordingInstruction | Slowly roll your head in a circle | | stepCenter | Look straight ahead | | stepTop | Tilt your face up | | stepTopLeft | Tilt your face up and left | | stepTopRight | Tilt your face up and right | | stepLeft | Turn your face left | | stepRight | Turn your face right | | outsideOval | Move your face into the oval | | maskWarning | We need to see your full face | | maskWarningDetail | Make sure nothing is covering your face | | labelCenter | Center | | labelTop | Top | | labelTopLeft | Top Left | | labelTopRight | Top Right | | labelLeft | Left | | labelRight | Right | | processingTitle | Analyzing | | processingSub | Selecting the best images from your motion... | | retryTitle | Let's try that again | | retrySub | We couldn't capture every angle. Roll your head a little slower so we can see each position. | | retryButton | Try Again | | resultTitle | Registration Complete | | resultSub | {{count}} face images captured successfully | | registerAgain | Register Again | | save | Save & Continue | | discard | Discard & Exit | | loadingModels | Loading face detection models... |

Exported Types

import type {
  Capture,
  FaceRegisterProps,
  FaceRegisterTranslations,
  StepName,
} from "@ngmthaq20/react-face-id-capture";

Requirements

  • HTTPS required for camera access (except localhost)
  • Face detection models are loaded from CDN (@vladmandic/face-api)
  • Works on desktop and mobile browsers

License

MIT