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

@yavqo/secureid

v1.0.1

Published

Yavqo SecureID — Enterprise client-side age & identity verification SDK. Biometric facial scanning, document OCR, and compliance-ready verification flows for modern web platforms.

Downloads

33

Readme

@yavqo/secureid

Yavqo SecureID — Enterprise client-side age & identity verification SDK. Drop-in biometric facial scanning, document OCR, and compliance-ready verification flows for modern web platforms.


Features

  • One-Line Setup: Just pass your clientId — configuration, audit logging, and verification rules are loaded automatically from your Developer Console.
  • Double Verification Workflow: Selfie facial alignment check + document OCR text extraction with cross-matching.
  • Biometric Scanner Simulation: Real-time face-mesh alignment drawn on a dynamic canvas over the camera feed.
  • Client-Side Privacy: All processing runs in the user's browser. No images or PII are sent to Yavqo servers.
  • React & Vanilla JS: Exported as ESM/CommonJS class and native React hooks/components.
  • Automatic Audit Logging: Every verification attempt is logged to your Supabase dashboard.

Installation

npm install @yavqo/secureid

Quick Start: Vanilla JS

import { SecureID } from '@yavqo/secureid';
import '@yavqo/secureid/css';

const verify = new SecureID({
  clientId: 'your-client-id',  // from your Developer Console
  onSuccess: (result) => {
    console.log('Verified!', result.age, result.dob);
  },
  onFailure: (result) => {
    console.error('Failed:', result.error);
  }
});

// Show the verification modal wherever you need it
document.getElementById('verify-button').addEventListener('click', () => {
  verify.open();
});

Quick Start: React / Next.js

1. Declarative Component Wrapper

import { useSecureID } from '@yavqo/secureid/react';
import '@yavqo/secureid/css';

function VerifyButton() {
  const { open } = useSecureID({
    clientId: 'your-client-id',
    onSuccess: (res) => console.log('Verified!', res.age),
    onFailure: (res) => console.error('Failed:', res.error),
  });

  return <button onClick={open}>Verify Age</button>;
}

2. Declarative Modal Component

import { SecureIDModal } from '@yavqo/secureid/react';
import '@yavqo/secureid/css';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Verify Identity</button>
      <SecureIDModal
        isOpen={isOpen}
        onClose={() => setIsOpen(false)}
        onSuccess={(result) => {
          console.log("Approved!", result.age);
          setIsOpen(false);
        }}
        options={{ supabaseClientId: 'your-client-id' }}
      />
    </div>
  );
}

API Reference

AgeVerifierOptions

| Property | Type | Default | Description | | :--- | :--- | :--- | :--- | | targetAge | number | 18 | Minimum age required to pass verification. | | mode | 'face' \| 'document' \| 'both' | 'both' | 'face': selfie only. 'document': ID only. 'both': double validation. | | sandbox | boolean | true | When true, runs client-side biometric and OCR text simulations. | | theme | 'light' \| 'dark' | 'dark' | Visual theme of the overlay modal panels. | | accentColor | string | '#10b981' | Theme accent color used for buttons, laser lines, and glowing ticks. | | endpointUrl | string | undefined | POST API endpoint to submit base64 image data to when sandbox: false. | | verifyHandler | Function | undefined | Async function to handle backend calculations manually. Overrides endpointUrl. | | onSuccess | (res: VerificationResult) => void | undefined | Callback fired on approval. | | onFailure | (res: VerificationResult) => void | undefined | Callback fired on rejection or error. | | onClose | () => void | undefined | Callback fired when the overlay is closed. |

VerificationResult

interface VerificationResult {
  success: boolean;
  mode: 'face' | 'document' | 'both';
  age?: number;
  dob?: string;
  documentDetails?: {
    type: string;
    name?: string;
    expiryDate?: string;
    documentNumber?: string;
  };
  confidence: number; // percentage (0 - 100)
  images: {
    face?: string; // base64 JPEG data URL
    document?: string; // base64 JPEG data URL
  };
  error?: string; // present on failed checks
}

Real Backend Integration

In production environments, switch sandbox: false and configure a secure verification endpoint or handler:

Using endpointUrl (HTTP POST)

The SDK will automatically post a payload containing base64 images to your server:

const verifier = new AgeVerifier({
  sandbox: false,
  endpointUrl: 'https://api.yourdomain.com/verify-identity',
  // ...
});

Request Payload sent by SDK:

{
  "faceImage": "data:image/jpeg;base64,...",
  "documentImage": "data:image/jpeg;base64,...",
  "mode": "both"
}

Your backend should process these images (using APIs like Google Cloud Vision or Amazon Rekognition) and respond with a JSON body matching the VerificationResult structure.

Supabase Integration

Yavqo SecureID supports logging session attempts automatically to your database and loading configuration rules dynamically. All tables are prefixed with secureid_.

1. Database Table Setup

Execute the SQL statements inside supabase_schema.sql in your Supabase SQL Editor. This initializes:

  • secureid_attempts: Storage for session outputs (Passed/Failed status, metadata, and optional base64 captured images).
  • secureid_configurations: Central rules registry to dynamic control of client verification options.

2. Client Initialization

Configure the SDK with your database details:

import { SecureID } from '@yavqo/secureid';

const secureID = new SecureID({
  targetAge: 18,
  supabaseEnabled: true,
  supabaseUrl: 'https://ikjugnimawkoatkbvpgk.supabase.co',
  supabaseKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlranVnbmltYXdrb2F0a2J2cGdrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODAwNzI3OTAsImV4cCI6MjA5NTY0ODc5MH0.xr9B_khj2zKIEoUsTisL66SGgn8Yo2K0YH5YDw0QmQw',
  
  // Optional: Fetch targetAge and mode remotely from secureid_configurations
  supabaseClientId: 'yavqo-enterprise-partner'
});

Browser Compatibility

  • Camera access: Supported in all modern mobile and desktop browsers (Chrome, Safari, Firefox, Edge). Requires an HTTPS context locally/in staging (localhost is exempted).
  • Dialog styling: Uses native HTML dialog components supporting Esc keys and backdrop captures. Includes polyfills to handle light-dismiss on Safari browsers.