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

buddi-chat-widget

v1.1.16

Published

A draggable, real-time chat widget for React applications

Downloads

1,222

Readme

buddi-chat-widget

React chat widget library with SSR-safe entry points for Next.js App Router and other modern bundlers.

Compatibility Matrix

| Area | Baseline / Supported | | --- | --- | | React runtime | >=18.3.1 <20 | | React DOM runtime | >=18.3.1 <20 | | Next.js test baseline | 15.0.7 | | Bundlers tested | Turbopack, Webpack, Vite | | Module formats | ESM + CJS |

Installation

npm install buddi-chat-widget

Package Exports

  • buddi-chat-widget:
    • import -> ESM runtime entry
    • require -> CJS runtime entry
    • types -> declaration entry
    • react-server -> server-safe placeholders
  • buddi-chat-widget/styles.css -> compiled distributable stylesheet
  • buddi-chat-widget/client -> explicit client-only entry (use client)
  • buddi-chat-widget/server -> explicit server-safe entry

Next 15 App Router Example

'use client';

import 'buddi-chat-widget/styles.css';
import { ChatWidget, FeatureFlagProvider } from 'buddi-chat-widget/client';

export default function SupportWidget() {
  return (
    <FeatureFlagProvider
      flags={{
        enableMessengerMode: true,
        enableClassicChat: true,
      }}
    >
      <ChatWidget />
    </FeatureFlagProvider>
  );
}

Vite Example

import React from 'react';
import ReactDOM from 'react-dom/client';
import 'buddi-chat-widget/styles.css';
import { ChatWidget, FeatureFlagProvider } from 'buddi-chat-widget/client';

ReactDOM.createRoot(document.getElementById('root')!).render(
  <FeatureFlagProvider>
    <ChatWidget />
  </FeatureFlagProvider>
);

SSR-Safe Import Example

import { ChatWidget } from 'buddi-chat-widget/server';

// Safe on server: this placeholder renders null.
export function ServerPreview() {
  return ChatWidget();
}

Styling and Theming

Import the packaged CSS once:

import 'buddi-chat-widget/styles.css';

The widget is scoped under .bdw-chat-widget to reduce host-style collisions and does not ship global html/body/* resets.

Theme Tokens (defaults)

Color tokens:

  • --color-brand: #EC4C32
  • --color-text-primary: #1B2025
  • --color-surface-default: #F7F9FC
  • --color-border-primary: #EAEEF2

Radius tokens:

  • --bdw-radius-sm: 8px
  • --bdw-radius-md: 12px
  • --bdw-radius-lg: 16px

Spacing tokens:

  • --bdw-space-1: 4px
  • --bdw-space-2: 8px
  • --bdw-space-3: 12px
  • --bdw-space-4: 16px

Shadow tokens:

  • --bdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08)
  • --bdw-shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12)

Font tokens:

  • --bdw-font-family: 'Manrope', sans-serif

Override tokens in your app CSS:

.bdw-chat-widget {
  --color-brand: #0c51af;
  --bdw-radius-lg: 20px;
}

Optional maximum isolation strategy: render your host wrapper in Shadow DOM and inject buddi-chat-widget/styles.css inside that shadow root.

Accessibility Baseline

  • Keyboard interactive controls use native button semantics.
  • Dialog controls include close actions and keyboard focusable elements.
  • Live message updates are rendered in readable DOM order for screen readers.
  • Ensure host theme overrides maintain WCAG AA contrast.

Security Baseline

  • Avoid dangerouslySetInnerHTML by default.
  • Validate URLs before rendering user-provided links.
  • Do not expose auth tokens in client logs.

Troubleshooting

document is not defined

Use buddi-chat-widget/client in client components only, or import from buddi-chat-widget/server for server-rendered placeholders.

CSS not applied

Ensure import 'buddi-chat-widget/styles.css'; runs once in your client bundle.

Next.js RSC boundary warning

Keep chat widget usage in files with 'use client'; or use dynamic client-side loading.

Release Notes

See RELEASE_NOTES.md for published compatibility and packaging changes.