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

@alefemacedo/eloquent-ai-chat-widget

v1.0.16

Published

A small, embeddable React chat widget built with Vite, React, and Tailwind CSS. It provides a customizable chat UI that can be mounted on any website as a UMD/ES module or run locally for development.

Downloads

1,832

Readme

Eloquent AI Chat Widget

A small, embeddable React chat widget built with Vite, React, and Tailwind CSS. It provides a customizable chat UI that can be mounted on any website as a UMD/ES module or run locally for development.

Features

  • Minimal embeddable widget built as a library (src/widget.tsx).
  • Customizable theme and colors via the UI (saved to localStorage).
  • Login/demo form for quick testing.
  • Built with Vite + React + Tailwind; ready to publish as a package.

Quick start

Requirements:

  • Node.js 18+ (the project was tested with Node 22)
  • npm or pnpm

Install dependencies:

npm install

Run the dev server:

npm run dev

Open http://localhost:5173 (Vite may choose another port if 5173 is busy).

Build for production:

npm run build

Preview production build:

npm run preview

Usage (development)

The app entry is src/index.tsx (demo) and the library entry is src/widget.tsx (used when building the UMD bundle).

In development the stylesheet is imported from src/index.tsx and src/widget.tsx:

import './styles/index.css'

Make sure Tailwind is processing your CSS. With the included setup we use the @tailwindcss/vite plugin which handles Tailwind v4 processing.

Mounting the widget in a page

When built as UMD / ES, the widget exposes a global EloquentAIChatWidget.mount(selector, props) function.

Example usage in a plain HTML page:

<div id="chat"></div>

<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="../dist/eloquent-widget.iife.js"></script>

<script>
  EloquentAIChatWidget.mount("#chat", {
    apiKey: "YOUR_OPENAI_BROWSER_KEY"
  });
</script>

Configuration & theming

  • Theme and config are stored in localStorage under chatTheme and chatConfig.
  • You can also programmatically pass apiKey and other config values when mounting the widget.

Tailwind notes & troubleshooting

If you see that Tailwind classes (for example bottom-6, right-6, etc.) are not applied:

  1. Ensure your src/styles/index.css contains Tailwind directives (for v4 usage with the plugin we expect):
@tailwind base;
@tailwind components;
@tailwind utilities;
  1. Make sure tailwind.config.js content globs include your templates and the demo HTML:
export default {
  content: ['./index.html', './src/**/*.{js,jsx,ts,tsx,html}', './public/**/*.{html,js}'],
}
  1. If you use the @tailwindcss/vite plugin (recommended for Tailwind v4), prefer letting the plugin handle PostCSS integration. If you added Tailwind directly to postcss.config.cjs, check compatibility with the plugin and Tailwind version.

  2. As a temporary workaround you can add a safelist to tailwind.config.js to force-generation of utilities used by the widget.

Publishing to npm

To publish the package to npm (public):

npm publish --access public

Notes:

  • Make sure you are logged in (npm whoami) and have permission to publish the package name in package.json.
  • If your account or organisation requires 2FA, you'll be prompted for an OTP during publish. For automated CI publishing create a granular automation token with the appropriate permissions and (if required) the "Bypass 2FA" option enabled.

Troubleshooting publish errors

  • 403 Forbidden - You do not have permission to publish "<name>". — you are not the owner of the package name. Choose another name or request access.
  • 403 Forbidden - Two-factor authentication ... — create a token with bypass or publish interactively and provide OTP.
  • If you accidentally passed a positional argument when running npm publish, npm may have tried to publish the wrong folder (for example public). Use the correct flag spelling: --access public.

Contributing

Contributions welcome. Please open issues or PRs. Keep changes small and add tests where applicable.

License

MIT