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

@biologreen/react

v1.0.1

Published

The official React SDK for the Bio-Logreen Facial Authentication API.

Downloads

5

Readme

Bio-Logreen React SDK

The official React SDK for the Bio-Logreen Facial Authentication API.

This SDK provides a headless React Hook (useBioLogreen) that manages camera access, real-time face detection, and API communication, giving you the flexibility to build a completely custom UI for your login and signup flows.

Features

Headless by Design: Provides all the logic; you provide the UI.

Promise-Based API: Modern async/await friendly functions (signupWithFace, loginWithFace) for clean code.

Simple Hook-based API: Integrates seamlessly into your React components.

Consistent Configuration: Uses the standard apiKey and baseURL props, matching the other Bio-Logreen SDKs.

Installation

npm install @biologreen/react react-webcam face-api.js axios

Setup & Configuration

This SDK relies on face-api.js for face detection, which requires model files to be available in your application.

Download AI Models: You must download the tiny_face_detector model weights from the face-api.js repository.

Host the Models:

Place the downloaded model files in your project's /public/models directory. The SDK will automatically fetch them from this location.

Quick Start: Usage Example

Here is a complete example of a login component that uses the useBioLogreen hook.

import React from 'react'; import Webcam from 'react-webcam'; import { useBioLogreen } from '@biologreen/react';

function MyLoginComponent() { // 1. Initialize the hook with your API key const { webcamRef, modelsLoaded, isLoading, error, signupWithFace, loginWithFace, } = useBioLogreen({ apiKey: 'YOUR_PROJECT_API_KEY', baseURL: 'http://localhost:8000/v1' // Optional: for local testing });

const handleSignup = async () => { try { const response = await signupWithFace(); alert(Signup Success! User ID: ${response.user_id}); console.log('Signup Response:', response); } catch (err) { alert(Signup Failed: ${err.detail || err.message}); console.error('Signup Error:', err); } };

const handleLogin = async () => { try { const response = await loginWithFace(); alert(Login Success! User ID: ${response.user_id}); console.log('Login Response:', response); } catch (err) { alert(Login Failed: ${err.detail || err.message}); console.error('Login Error:', err); } };

if (!modelsLoaded) { return Loading AI Models...; }

return ( Bio-Logreen Authentication <div style={{ position: 'relative', width: '640px' }}> {isLoading && <div style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, background: 'rgba(0,0,0,0.5)', color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>Processing...}

  <div>
    <button onClick={handleSignup} disabled={isLoading}>
      Sign Up with Face
    </button>
    <button onClick={handleLogin} disabled={isLoading}>
      Log In with Face
    </button>
  </div>

  {error && <p style={{ color: 'red' }}>Error: {error.detail || error.message}</p>}
</div>

); }

export default MyLoginComponent;

API Reference

useBioLogreen({ apiKey, baseURL })

Parameters apiKey (string, required): Your project's secret API key.

baseURL (string, optional): A custom base URL for the Bio-Logreen API. Defaults to the production URL.

Return Values webcamRef: A React ref object to be attached to your component.

modelsLoaded (boolean): true once the required AI models have been loaded.

isLoading (boolean): true when an API call is in progress.

error (object | null): An error object if the last operation failed.

signupWithFace(customFields): An async function to trigger a signup. Returns a Promise.

loginWithFace(): An async function to trigger a login. Returns a Promise.