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

chatsy

v2.0.12

Published

Embeddable AI chatbot widget. Add a chat widget to any website with one line of code.

Readme

Free AI customer service chatbot agent

Quick Start

1. Create an Agent

Go to chatsy.ai/dashboard/agents/new to create your AI agent. Configure your brand info, knowledge base, response style, and welcome message. Copy the Agent ID when you're done.

2. Add to Your Website

Script tag (no build tools needed):

<script
  src="https://cdn.jsdelivr.net/npm/chatsy@latest/dist/chatsy.min.js"
  data-agent-id="YOUR_AGENT_ID"
></script>

A chat button appears in the bottom-right corner. Click it to open the chat.

NPM (for React, Vue, Next.js, etc.):

npm install chatsy
// ESM
import Chatsy from 'chatsy';

// CommonJS
const Chatsy = require('chatsy');
const chat = new Chatsy('YOUR_AGENT_ID');

Configuration

Script Tag Attributes

| Attribute | Default | Description | |-----------|---------|-------------| | data-agent-id | required | Your agent ID from the dashboard | | data-button-background-color | #297bf7 | Button background color | | data-button-text-color | #FFFFFF | Button icon color | | data-button-position | bottom-right | bottom-right or bottom-left | | data-button-type | round | Button shape: round or square | | data-button-icon | default | Icon style: default, material, or rounded |

Note: User data (user, context) is not supported via script tag attributes. Use the JavaScript API with setUser() for dynamic user identification.

JavaScript Options

const chat = new Chatsy('YOUR_AGENT_ID', {
  settings: {
    button: {
      backgroundColor: '#297bf7', // Button background color
      textColor: '#FFFFFF',       // Button icon color
      position: 'bottom-right',   // 'bottom-right' or 'bottom-left'
      type: 'round',              // 'round' or 'square'
      icon: 'default',            // 'default', 'material', or 'rounded'
    },
  },
  user: {
    id: 'user-123',               // Unique user ID
    firstName: 'Jane',            // First name (avatar initials, sent to AI)
    lastName: 'Smith',            // Last name (avatar initials, sent to AI)
    email: '[email protected]',    // Sent to AI as context
    photoURL: 'https://...',      // Profile picture URL (replaces initials avatar)
    // ...any other scalar fields are sent to the AI
  },
  context: {
    // page.url, page.referrer, page.title are auto-collected
    tags: ['vip', 'enterprise'],  // Labels for filtering conversations
    metadata: { planId: 'pro' },  // Arbitrary key/values (scalars only)
  },
});

API

Methods

| Method | Description | |--------|-------------| | chat.open() | Open the chat window | | chat.close() | Close the chat window | | chat.toggle() | Toggle open/close | | chat.send('Hello!') | Send a message programmatically | | chat.setUser({ id, firstName, ... }) | Update user identity (e.g., after auth state change) | | chat.getMessages() | Get all messages as an array | | chat.destroy() | Remove the widget from the page |

Events

chat.on('ready', () => { /* Widget loaded */ });
chat.on('open', () => { /* Chat opened */ });
chat.on('close', () => { /* Chat closed */ });
chat.on('message', (msg) => { /* New message received */ });
chat.on('error', (err) => { /* Error occurred */ });

Multiple Instances

Each instance is independent, so you can run multiple widgets on the same page:

const support = new Chatsy('support-agent-id');
const sales = new Chatsy('sales-agent-id', {
  settings: { button: { position: 'bottom-left', backgroundColor: '#10B981' } },
});

How It Works

  1. A floating chat button is injected into your page (a regular DOM element, not an iframe)
  2. Clicking it lazily creates an iframe with the chat interface (no impact on initial page load)
  3. Messages are sent to your AI agent via the Chatsy API
  4. The agent responds based on your configured knowledge base, brand info, and instructions

Agent Configuration

Configure your agent at chatsy.ai/dashboard:

| Setting | What It Does | |---------|-------------| | Brand info | Company name, website, phone, description | | Knowledge base | Products, services, and additional context the agent should know | | Processes | Cancellation, refund, return, and shipping policies | | Response style | Tone (professional, friendly, casual) and custom instructions | | Welcome message | First message visitors see when opening chat | | AI model | Standard (GPT-4o Mini) or Advanced (GPT-4o) |

Development

npm start        # Watch mode - rebuilds on file changes
npm run build    # One-time build (ESM, CJS, UMD)
npm test         # Run tests

Build Outputs

| File | Format | Use Case | |------|--------|----------| | dist/index.mjs | ESM | import in modern bundlers (webpack, Vite, etc.) | | dist/index.js | CJS | require() in Node.js | | dist/chatsy.min.js | IIFE (minified) | <script> tag / CDN |

Local Testing

Open test/browser.html in your browser to test the widget locally.

License

MIT