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

@rexai/pulse-react

v2.1.0

Published

React SDK for rPPG health analysis - measure heart rate, HRV, SpO2, voice biomarkers from any camera

Readme

@rexai/pulse-react

React SDK for comprehensive health analysis - measure heart rate, HRV, SpO2, skin health, voice biomarkers, and eye health from any camera or microphone using AI-powered analysis.

Installation

npm install @rexai/pulse-react
# or
yarn add @rexai/pulse-react
# or
pnpm add @rexai/pulse-react

Quick Start

import { PulseScanner, VitalsCard } from '@rexai/pulse-react';
import '@rexai/pulse-react/styles.css';
import { useState } from 'react';

function App() {
  const [vitals, setVitals] = useState(null);

  return (
    <div>
      <PulseScanner
        apiKey="pk_live_YOUR_API_KEY"
        duration={10}
        showMesh={true}  // Show face mesh overlay
        onResult={(result) => setVitals(result)}
        onError={(err) => console.error(err)}
      />
      
      {vitals && (
        <VitalsCard
          heartRate={vitals.heart_rate}
          spo2={vitals.spo2}
          stressIndex={vitals.stress_index}
          hrvSdnn={vitals.hrv_sdnn}
        />
      )}
    </div>
  );
}

Note: The SDK automatically uses your VITE_API_URL environment variable for the backend URL.

Components

PulseScanner

The main component for capturing and analyzing vital signs.

<PulseScanner
  apiKey="pk_live_..."           // Required: Your API key
  duration={10}                   // Scan duration in seconds (default: 10)
  onResult={(vitals) => {...}}    // Called with results
  onError={(error) => {...}}      // Called on error
  theme="light"                   // "light" | "dark" | "minimal"
  showPreview={true}              // Show camera preview
  showOverlay={true}              // Show face detection overlay
  showMesh={true}                 // Show face mesh lines (default: false)
  showCountdown={true}            // Show countdown during recording
  userData={{                     // Optional user data for calibration
    age: 30,
    sex: 'male'
  }}
/>

VitalsCard

Display component for vital sign results.

<VitalsCard
  heartRate={72}
  spo2={98}
  stressIndex={25}
  hrvSdnn={45}
  respiratoryRate={16}
  bloodPressure={{ systolic: 120, diastolic: 80 }}
  recoveryScore={85}
  showAll={true}                  // Show extended metrics
  compact={false}                 // Compact layout
  theme="light"                   // "light" | "dark"
/>

API Client

For programmatic access without the UI components:

import { PulseClient } from '@rexai/pulse-react';

const client = new PulseClient({
  apiKey: 'pk_live_YOUR_API_KEY'
});

// Analyze a video blob for medical vitals
const vitals = await client.analyze({
  video: videoBlob,
  age: 30,
  sex: 'male'
});

console.log(vitals.heart_rate);  // 72
console.log(vitals.spo2);        // 98

// Analyze beauty/skin metrics
const beauty = await client.analyzeBeauty({
  video: videoBlob,
  age: 30,
  gender: 'female'
});

console.log(beauty.summary.skin_age);  // 28
console.log(beauty.surface.hydration); // 75

// Analyze voice for health biomarkers
const voice = await client.analyzeVoice({
  audio: audioBlob
});

console.log(voice.stress_score);       // 35
console.log(voice.respiratory_rate);   // 16
console.log(voice.wellness_score);     // 72

// Analyze eye health
const eye = await client.analyzeEye({
  video: videoBlob
});

console.log(eye.overall_score);        // 85
console.log(eye.cataract.risk_level);  // "low"
console.log(eye.red_eye.is_inflamed);  // false
console.log(eye.recommendations);      // ["Maintain regular eye exams", ...]

Hooks

For building custom UI:

import { useCamera, useFaceDetection, useRecording } from '@rexai/pulse-react';

function CustomScanner() {
  const { videoRef, isActive, start, stop } = useCamera();
  const { detected, qualityMessage, isQualityGood } = useFaceDetection(videoRef.current);
  const { isRecording, timeLeft, blob, start: startRecording } = useRecording(stream);
  
  // Build your own UI...
}

Vitals Returned

Medical Analysis (analyze)

| Metric | Type | Description | |--------|------|-------------| | heart_rate | number | Heart rate in BPM | | spo2 | number | Oxygen saturation % | | hrv_sdnn | number | HRV (SDNN) in ms | | hrv_rmssd | number | HRV (RMSSD) in ms | | stress_index | number | Stress index (0-100) | | respiratory_rate | number | Breaths per minute | | blood_pressure | object | Estimated BP (systolic/diastolic) | | recovery_score | number | Recovery score % | | vascular_age | number | Estimated vascular age |

Voice Analysis (analyzeVoice)

| Metric | Type | Description | |--------|------|-------------| | stress_score | number | Voice stress score (0-100) | | fatigue_score | number | Fatigue indicator (0-100) | | anxiety_level | string | Anxiety level (low/mild/moderate/high) | | respiratory_rate | number | Breathing rate from audio | | respiratory_health | number | Respiratory health score | | cough_detected | boolean | Cough presence detected | | depression_risk | string | Depression risk indicator | | cognitive_load | string | Mental load level | | wellness_score | number | Overall wellness (0-100) | | composite_scores | object | Mental, physical, cognitive, resilience scores |

Eye Analysis (analyzeEye)

| Metric | Type | Description | |--------|------|-------------| | overall_score | number | Overall eye health score (0-100) | | health_level | string | Health level (Excellent/Good/Fair/Needs Attention) | | cataract | object | Cataract screening results | | cataract.opacity_score | number | Lens opacity measurement (0-100) | | cataract.risk_level | string | Risk level (low/mild/moderate/high) | | red_eye | object | Red eye/inflammation detection | | red_eye.redness_score | number | Redness measurement (0-100) | | red_eye.is_inflamed | boolean | Inflammation detected | | lens_clarity | object | Lens clarity assessment | | pupil | object | Pupil analysis results | | pterygium | object | Pterygium detection | | stye | object | Stye/chalazion detection | | sclera | object | Sclera health (yellowing/jaundice risk) | | recommendations | string[] | Personalized recommendations | | analysis_confidence | number | Analysis confidence % |

Getting an API Key

Contact us for API access or visit the developer portal to generate your API key.

License

MIT