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

cataract-detection-auraehealth

v1.0.4

Published

Catarat detection using eye-scanning technology for Aurae Health.

Downloads

14

Readme

Cataract Detection by Aurae Health

A comprehensive JavaScript package for detecting cataracts using eye-scanning technology. This package provides a complete UI system for face detection, eye scanning, and cataract analysis through Aurae Health's cloud-based API. No separate API setup needed - this package works out of the box with our pre-configured cloud service.

Features

  • 🔍 Real-time face detection and tracking
  • 👁️ High-resolution eye scanning technology
  • 📱 Responsive design for both desktop and mobile devices
  • 🔄 Camera switching capability for mobile devices
  • 📊 Integration with Aurae Health's cataract detection API
  • 🛡️ Privacy-focused approach (all processing happens on-device or securely in the cloud)
  • 💻 Easy integration with any website or web application

Installation

npm install cataract-detection-auraehealth

Quick Start

1. Import the package

// Import the CSS
import 'cataract-detection-auraehealth/styles.css';

// Import the package
import CataractDetection from 'cataract-detection-auraehealth';

2. Initialize the detection system

// Create a container element in your HTML
<div id="cataract-detection-container"></div>

// Initialize the detection system
const cataractDetector = CataractDetection.initialize({
  container: document.getElementById('cataract-detection-container'),
  userId: 'user123',
  userName: 'John Doe',
  // apiKey is optional - a default key is built into the package
  onVerificationComplete: () => {
    console.log('Cataract scan completed successfully');
  },
  onVerificationFailed: (error) => {
    console.error('Scan failed:', error);
  }
});

3. Start the scan

// Start the scan manually
cataractDetector.startScan();

// Or, use auto-start on initialization
const cataractDetector = CataractDetection.initialize({
  // ... other options
  autoStart: true
});

API Reference

Initialization Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | container | HTMLElement | Yes | - | The DOM element where the UI will be rendered | | userId | String | Yes | - | Unique identifier for the user | | userName | String | Yes | - | User's name | | apiKey | String | No | TvWHmZ6gY09BA9D9SgYwW1um7IGQyZdz2c8Xh57X | API key for the Aurae Health API (built-in default works out of the box) | | apiUrl | String | No | https://wfjtn1mx1e.execute-api.ap-south-1.amazonaws.com/dev/image | API endpoint (built-in default connects to Aurae Health's cloud) | | autoStart | Boolean | No | false | Automatically start scanning on initialization | | onVerificationComplete | Function | No | - | Callback function when verification is successful | | onVerificationFailed | Function | No | - | Callback function when verification fails | | onBack | Function | No | - | Callback function when the back button is clicked |

Methods

initialize(options)

Initializes the cataract detection system with the provided options.

const detector = CataractDetection.initialize(options);

startScan()

Starts the face and eye scanning process.

detector.startScan();

switchCamera()

Switches between front and rear cameras on mobile devices.

detector.switchCamera();

destroy()

Cleans up all resources and stops the camera.

detector.destroy();

User Flow

  1. The system first calibrates the user's facial alignment.
  2. Once calibrated, it prompts the user to keep their right eye wide open for scanning.
  3. After capturing the right eye, it proceeds to scan the left eye.
  4. The captured eye scans are securely sent to the Aurae Health API for cataract detection.
  5. Results are communicated back to the application through the callback functions.

Advanced Configuration

Custom API Endpoint (Optional)

By default, the package uses Aurae Health's cloud API for cataract detection. You only need to specify a custom API endpoint if you're hosting your own version of the API:

CataractDetection.initialize({
  // ... other options
  apiUrl: 'https://your-custom-api-endpoint.com/scan',
  apiKey: 'YOUR_CUSTOM_API_KEY'
});

Integration with React

import React, { useEffect, useRef } from 'react';
import 'cataract-detection-auraehealth/styles.css';
import CataractDetection from 'cataract-detection-auraehealth';

function CataractScanComponent() {
  const containerRef = useRef(null);
  const detectorRef = useRef(null);

  useEffect(() => {
    if (containerRef.current) {
      detectorRef.current = CataractDetection.initialize({
        container: containerRef.current,
        userId: 'user123',
        userName: 'John Doe',
        onVerificationComplete: handleScanComplete,
        onVerificationFailed: handleScanFailed
      });
    }

    return () => {
      if (detectorRef.current) {
        detectorRef.current.destroy();
      }
    };
  }, []);

  const handleScanComplete = () => {
    // Handle successful scan
  };

  const handleScanFailed = (error) => {
    // Handle failed scan
  };

  const startScan = () => {
    if (detectorRef.current) {
      detectorRef.current.startScan();
    }
  };

  return (
    <div>
      <div ref={containerRef} style={{ width: '100%', height: '600px' }}></div>
      <button onClick={startScan}>Start Cataract Scan</button>
    </div>
  );
}

export default CataractScanComponent;

Browser Compatibility

This package is compatible with modern browsers that support:

  • WebRTC (for camera access)
  • Canvas API
  • MediaPipe framework

For optimal performance, we recommend:

  • Chrome 83+
  • Firefox 76+
  • Safari 14.1+
  • Edge 83+

Dependencies

This package relies on the following libraries:

Troubleshooting

Camera Access Issues

If users are experiencing camera access problems:

  1. Ensure the website is served over HTTPS (required for camera access)
  2. Check that camera permissions are granted in the browser
  3. On mobile devices, ensure the app has camera permissions

Detection Accuracy

For best detection results:

  1. Use in well-lit environments
  2. Avoid strong backlighting
  3. Position the face naturally and centered in the frame
  4. Keep eyes wide open during the scanning process

Privacy Considerations

  • All face processing happens directly on the user's device
  • Only the eye scan images are sent to the API for cataract detection
  • No biometric data is stored permanently without explicit user consent

License

This package is licensed under the MIT License - see the LICENSE file for details.

Author

Created by Ana Fariya for Aurae Health.


For additional support or feature requests, please contact us at [email protected].