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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@abdullohrashidov/widget-ia

v1.0.9

Published

Embeddable React Widget

Downloads

24

Readme

AI Chat Widget

Features

  • Self-contained (React bundled, no dependencies)
  • Shadow DOM isolation (no CSS conflicts)
  • TypeScript support
  • WebSocket ready
  • Multi-platform support via clientKey
  • Dual builds: npm package + standalone script
  • Lightweight (183 KB package, 193 KB standalone)
  • Production-ready

Bundle Sizes

| File | Size | React | Usage | | ------------------------ | ------ | -------------------------- | ------------------------- | | index.js | 1.4 KB | External (peer dependency) | React/Next.js/Vue | | widget.css | 6.4 KB | - | Styles | | widget.standalone.js | 187 KB | Bundled | WordPress/HTML (optional) |

Installation

Option 1: Via npm (for React/Next.js apps)

npm install @abdullohrashidov/widget-ia
// Import the component
import { WidgetContainer } from "@abdullohrashidov/widget-ia";
// Import the styles
import "@abdullohrashidov/widget-ia/dist/widget.css";

function App() {
  return <WidgetContainer clientKey="your-platform-key" />;
}

For Next.js:

// app/page.tsx
"use client";

import { WidgetContainer } from "@abdullohrashidov/widget-ia";
import "@abdullohrashidov/widget-ia/dist/widget.css";

export default function Home() {
  return <WidgetContainer clientKey="health-dept-portal" />;
}

Option 2: Via CDN (for any website)

For websites without React, use the standalone version (React bundled):

<!DOCTYPE html>
<html>
  <body>
    <!-- Your content -->

    <!-- Add widget (standalone - no React needed) -->
    <script
      src="https://unpkg.com/@abdullohrashidov/widget-ia@latest/dist/widget.standalone.js"
      data-client-key="your-platform-key"
    ></script>
  </body>
</html>

Alternative: If your site already has React loaded globally:

<!-- Load React (if not already) -->
<script
  crossorigin
  src="https://unpkg.com/react@19/umd/react.production.min.js"
></script>
<script
  crossorigin
  src="https://unpkg.com/react-dom@19/umd/react-dom.production.min.js"
></script>

<!-- Then use smaller package version -->
<script
  src="https://unpkg.com/@abdullohrashidov/widget-ia@latest/dist/widget.js"
  data-client-key="your-platform-key"
></script>

Configuration

clientKey

The clientKey identifies which platform the widget is running on. Each platform should have a unique key.

Example:

<!-- Health Department Portal -->
<script src="..." data-client-key="health-dept-portal"></script>

<!-- Tax Filing System -->
<script src="..." data-client-key="tax-filing-system"></script>

API

React Component Props

interface WidgetContainerProps {
  clientKey: string; // Required: Platform identifier
}

Context Available

import { useContext } from "react";
import { WidgetContext } from "@abdullohrashidov/widget-ia";

function MyComponent() {
  const { clientKey, isOpen, setIsOpen } = useContext(WidgetContext);
  // Use context...
}

Development

# Install dependencies
npm install

# Run development server
npm run dev

# Build widget
npm run build:widget

# Build development version (with source maps)
npm run build:widget:dev

Browser Support

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+
  • All modern browsers with Shadow DOM support

License

MIT

Author

Abdullo Rashidov

Support

For issues and questions, please open an issue on GitHub.