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

booya-sdk

v1.0.2

Published

Real-time audience measurement and emotion detection SDK powered by Booya AI

Readme

booya-sdk

Real-time audience measurement and emotion detection SDK powered by Booya AI.

Detect faces, track engagement, and measure emotional response in real-time using WebAssembly — all client-side. Events are logged to the Booya backend for analytics and dashboards.

Install

npm install booya-sdk

Quick Start

import { BooyaSDK } from 'booya-sdk';

const booya = new BooyaSDK({
  apiKey: 'bya_your_api_key',
  appId: 'your-base44-app-id',
});

await booya.init('#camera');
const sessionId = await booya.startSession();

booya.onMetrics((m) => {
  console.log(m.emotions);      // { happy, sad, surprised, angry, neutral, disgust }
  console.log(m.viewerCount);   // people actively looking at camera
  console.log(m.totalPersons);  // total faces detected
});

// When done:
const summary = await booya.endSession();
<div id="camera" style="width: 640px; height: 480px;"></div>

React

import { useBooya } from 'booya-sdk/react';

function MeasurementView() {
  const { containerRef, metrics, isRecording, start, stop, error } = useBooya({
    apiKey: 'bya_your_api_key',
    appId: 'your-base44-app-id',
  });

  return (
    <div>
      <div ref={containerRef} style={{ width: 640, height: 480 }} />
      {metrics && <p>Emotion: {metrics.dominantEmotion}</p>}
      <button onClick={isRecording ? stop : start}>
        {isRecording ? 'Stop' : 'Start'}
      </button>
    </div>
  );
}

WASM Assets

The SDK requires three WASM engine files at runtime:

  • demo.js — loader script
  • demo.wasm — WebAssembly binary
  • demo.data — model data (~30MB)

Option A — Host on your own CDN and pass cdnBase:

new BooyaSDK({ apiKey, appId, cdnBase: 'https://pub-8a8663514dfc4903b92d92bad4ead7b1.r2.dev' });

Option B — Place files in your public directory (e.g. /public/demo.js).

Configuration

| Option | Type | Default | Description | |---|---|---|---| | apiKey | string | required | Your Booya API key | | appId | string | required | Base44 application ID | | cdnBase | string | '' | CDN URL for WASM assets | | dashboardId | string | null | Scope session to a dashboard | | skin | string | 'default' | Overlay: 'default', 'minimal', 'none' | | metricsInterval | number | 200 | Read metrics every N ms | | eventInterval | number | 2000 | Log events every N ms | | onMetrics | function | null | Callback for real-time metrics | | onError | function | null | Callback for errors |

API Methods

BooyaSDK

| Method | Returns | Description | |---|---|---| | init(container) | Promise<void> | Load WASM and attach to a container element | | startSession() | Promise<string> | Start camera, create session, return session_id | | endSession() | Promise<SessionSummary> | Stop recording and return session summary | | onMetrics(cb) | void | Register real-time metrics callback | | onError(cb) | void | Register error callback | | getMetrics() | BooyaMetrics \| null | Latest metrics snapshot | | isReady() | boolean | Whether the engine is loaded | | isRecording() | boolean | Whether a session is active | | destroy() | void | Clean up all resources |

Static API (data-only, no WASM)

const sessions = await BooyaSDK.api.getSessions(apiKey, appId, { dashboardId });
const session  = await BooyaSDK.api.getSession(apiKey, appId, sessionId);
const analytics = await BooyaSDK.api.getAnalytics(apiKey, appId, { startDate, endDate });

Metrics Object

{
  emotions: { happy, sad, surprised, angry, neutral, disgust }, // 0-100
  viewerCount: number,     // people actively looking at camera
  totalPersons: number,    // total faces detected
  engagementScore: number, // 0-100 aggregate score
  dominantEmotion: string  // highest-scored emotion
}

License

MIT