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

@my-aichatbot/chat

v1.0.1

Published

Embeddable AI chatbot widget for web applications

Downloads

8

Readme

@my-aichatbot/chat

Embeddable AI chatbot widget for your website. A lightweight, customizable chat widget that can be embedded in any website via npm or CDN.

Installation

Via npm

npm install @my-aichatbot/chat

Via CDN (jsDelivr)

<!-- ES Module -->
<script type="module">
  import { createChat } from 'https://cdn.jsdelivr.net/npm/@my-aichatbot/chat@latest/dist/chat.bundle.es.js';
  createChat({ botId: 'your-bot-id' });
</script>

<!-- UMD (Global) -->
<script src="https://cdn.jsdelivr.net/npm/@my-aichatbot/chat@latest/dist/chat.bundle.umd.js"></script>
<script>
  ChatbotWidget.createChat({ botId: 'your-bot-id' });
</script>

Quick Start

Basic HTML Integration

<!DOCTYPE html>
<html>
<head>
  <title>My Website</title>
</head>
<body>
  <h1>Welcome to my site</h1>
  
  <!-- Add the chatbot widget -->
  <script type="module">
    import { createChat } from 'https://cdn.jsdelivr.net/npm/@my-aichatbot/chat@latest/dist/chat.bundle.es.js';
    
    createChat({
      botId: 'your-bot-id',
      locale: 'en',
      position: 'right',
      theme: 'light',
      primaryColor: '#007bc8'
    });
  </script>
</body>
</html>

React/Next.js Integration

import { useEffect } from 'react';
import { createChat } from '@my-aichatbot/chat';

function MyApp() {
  useEffect(() => {
    const widget = createChat({
      botId: 'your-bot-id',
      locale: 'en'
    });

    // Clean up on unmount
    return () => {
      widget.destroy();
    };
  }, []);

  return <div>Your app content</div>;
}

Vue.js Integration

<template>
  <div>Your app content</div>
</template>

<script>
import { createChat } from '@my-aichatbot/chat';

export default {
  mounted() {
    this.widget = createChat({
      botId: 'your-bot-id',
      locale: 'en'
    });
  },
  
  beforeDestroy() {
    if (this.widget) {
      this.widget.destroy();
    }
  }
};
</script>

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | botId | string | required | Your chatbot's unique identifier | | apiUrl | string | 'https://app.my-aichatbot.com' | API base URL (usually not needed) | | locale | string | 'en' | Language locale for the chat interface | | position | 'left' \| 'right' | 'right' | Widget position on the screen | | theme | 'light' \| 'dark' \| 'auto' | 'auto' | Color theme | | primaryColor | string | '#007bc8' | Primary color for the chat button | | buttonSize | number | 60 | Size of the chat button in pixels | | zIndex | number | 9999 | CSS z-index for the widget | | width | number | 400 | Width of the chat window in pixels | | height | number | 600 | Height of the chat window in pixels | | launcherText | string | 'Chat with us' | Text on the launcher button | | launcherTextColor | string | '#ffffff' | Color of the launcher button text | | shadowColor | string | 'rgba(15, 23, 42, 0.18)' | Shadow color for widget elements | | welcomeMessage | string | 'Hi there! How can we help you today?' | Welcome message |

API Methods

createChat(config)

Creates and initializes a new chatbot widget.

const widget = createChat({
  botId: 'abc123'
});

Returns a ChatbotWidget instance.

widget.destroy()

Removes the widget from the page and cleans up resources.

widget.destroy();

Features

  • 🚀 Lightweight - Minimal bundle size with all dependencies included
  • 📱 Mobile Responsive - Automatically adapts to mobile screens
  • 🎨 Customizable - Extensive styling options
  • Accessible - ARIA labels and keyboard navigation
  • 🔒 Secure - Iframe isolation for security
  • 📦 Zero Dependencies - All dependencies bundled in production build
  • 🌍 CDN Ready - Works with jsDelivr, unpkg, and other CDNs

Development

Building from Source

# Clone the repository
git clone https://github.com/yourusername/chatbot-widget.git
cd chatbot-widget-npm

# Install dependencies
npm install

# Build the widget
npm run build

# Test locally
npm run test

Publishing to npm

When you're ready to publish:

# Login to npm
npm login

# Publish the package
npm publish --access public

After publishing, the widget will be automatically available via:

  • npm: npm install @my-aichatbot/chat
  • jsDelivr CDN: https://cdn.jsdelivr.net/npm/@my-aichatbot/chat@latest/dist/chat.bundle.es.js
  • unpkg CDN: https://unpkg.com/@my-aichatbot/chat@latest/dist/chat.bundle.es.js

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

License

MIT License - see LICENSE file for details.