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

@streamoji/avatar-widget

v0.5.8

Published

Plug-and-play React avatar widget for token-based AI conversations.

Readme

@streamoji/avatar-widget

Plug-and-play avatar widget for token-based AI conversations. Use the React component in your app or drop in the script-tag (web) build on any HTML page—no React required.

Installation

npm install @streamoji/avatar-widget

Peer dependencies (install if not already present):

npm install react react-dom three @react-three/fiber @react-three/drei

Usage

import { AvatarWidget } from "@streamoji/avatar-widget";
import "@streamoji/avatar-widget/styles.css";

function App() {
  return (
    <AvatarWidget
      agentId="YOUR_AGENT_ID"
      onNavigationRequested={(url) => window.open(url, "_blank")}
    />
  );
}

With optional user prefill and avatar gender:

import { AvatarWidget } from "@streamoji/avatar-widget";
import "@streamoji/avatar-widget/styles.css";

function App() {
  const user = useCurrentUser(); // your auth

  return (
    <AvatarWidget
      agentId="YOUR_AGENT_ID"
      presetUserDetails={
        user
          ? { name: user.displayName, email: user.email, phone: user.phone }
          : undefined
      }
      onNavigationRequested={(url) => window.open(url, "_blank")}
    />
  );
}

Web flow (script tag, no React)

You can embed the widget on any HTML page without a React app. Use the UMD build and call the global init.

1. Build the UMD bundle (if you’re developing the package; otherwise use the published dist):

npm run build:html

2. Include the script and styles in your HTML:

<link rel="stylesheet" href="path/to/avatar-widget.umd.css">
<script src="path/to/avatar-widget.umd.js"></script>

For npm installs, the files are in node_modules/@streamoji/avatar-widget/dist/ (e.g. avatar-widget.umd.js, avatar-widget.umd.css). You can copy them to your static assets or point your bundler at them.

3. Initialize the widget (e.g. before </body>):

<script>
  StreamojiLeadsAvatarWidget.init({ agentId: "YOUR_AGENT_ID" });
</script>

If you don’t add a container, the widget creates one fixed at the bottom-right of the page. To control placement, add a div with id streamoji-leads-avatar-widget-root where the widget should mount:

<div id="streamoji-leads-avatar-widget-root"></div>
<script>
  StreamojiLeadsAvatarWidget.init({ agentId: "YOUR_AGENT_ID" });
</script>

Session UID generation uses the Web Crypto API and requires a secure context (HTTPS or localhost). On plain HTTP, HMAC-based session IDs will not be available.

Web init options

| Option | Type | Description | |--------|------|-------------| | agentId | string | Agent ID; widget fetches config (and records visit) and uses it for chat/STT. |

Props (React)

| Prop | Type | Description | |------|------|-------------| | agentId | string | Agent ID to fetch config and for chat/STT. | | onNavigationRequested | (url: string) => void | Called when the agent requests a link; if not provided, links open in a new tab. | | avatarGender | "male" \| "female" | Gender of the avatar for idle animations. Defaults to "male". | | presetUserDetails | UserDetails \| undefined | Optional user details (name, email, phone) to identify logged-in users and skip lead capture. |

UserDetails

interface UserDetails {
  name?: string;
  email?: string;
  phone?: string;
}

Publishing

From the repo root:

cd packages/avatar-widget
npm run build       # React build
npm run build:html  # optional: UMD bundle for web/script-tag usage (or use npm run build:all)
npm version patch   # or minor / major
npm publish --access public

Scoped packages require --access public if the scope is not on a paid npm plan.