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

@chatmode/embed

v0.1.7

Published

A lightweight embeddable chat widget for Chatmode that can be added to any website.

Readme

@chatmode/embed

A lightweight embeddable chat widget for Chatmode that can be added to any website.

Installation

NPM

npm install @chatmode/embed

CDN

You can also use the package directly from jsDelivr CDN:

<script type="module">
  import Chatmode from "https://cdn.jsdelivr.net/npm/@chatmode/embed/+esm";

  // Initialize the chat bubble
  Chatmode.initBubble({
    environmentId: "your-environment-id",
    iconKey: "/environment/**",
    /* Used to cache-bust your icon. Make sure to keep this updated */
    updatedAt: 1743552265135,
    /* "bottom-left" or "bottom-right" (default) */
    position: "bottom-right",
  });
</script>

Usage

Initialize chat bubble

Add the following code to your website to display a chat bubble that opens a chat modal when clicked:

import Chatmode from "@chatmode/embed";

// Initialize the chat bubble
const chat = Chatmode.initBubble({
  environmentId: "your-environment-id",
  /* Optional: "light", "dark", or "automatic" (default) */
  theme: "automatic",
  iconKey: "/environment/**",
  /* Used to cache-bust your icon. Make sure to keep this updated */
  updatedAt: 1743552265135,
  /* "bottom-left" or "bottom-right" (default) */
  position: "bottom-right",
});

// Optional: Control the chat programmatically
// chat.open(); // Open the chat modal
// chat.close(); // Close the chat modal

API Reference

Chatmode.initBubble(options)

Creates and initializes the chat bubble on your website.

Parameters:

  • options (object) - Configuration options:
    • environmentId (string) - Your Chatmode environment ID
    • position ("bottom-left" | "bottom-right") - Where the Chat Bubble is rendered at
    • theme (string, optional) - Theme to use for the chat widget:
      • "light" - Forces light theme
      • "dark" - Forces dark theme
      • "automatic" - Automatically detects theme based on user's system preferences or website settings (default)

Returns:

An object with methods to control the chat:

  • open() - Opens the chat modal
  • close() - Closes the chat modal
  • toggle() - Toggles the chat modal open/closed
  • isOpen() - Returns true if the chat modal is open
  • remove() - Unmounts the chat bubble and modal

Theme Detection

When theme is set to "automatic" or not provided, the widget will detect the appropriate theme in the following order:

  1. Check for data-theme="dark" or data-theme="light" attribute on the <html> element
  2. Check for dark or light class on the <html> element
  3. Check the user's system preference using prefers-color-scheme media query

The widget will automatically update if any of these values change.