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

sales-bot-chat-widget

v0.1.2

Published

Embeddable RAG sales-chat widget for Keyon property microsites.

Readme

@keyon/chat-widget

Embeddable sales-chat widget for Keyon property microsites. Two ways in.

1. Script tag — no build step

For a microsite that is plain HTML. React is bundled; nothing else to install.

<script
  src="https://your-cdn/keyon-widget.js"
  data-project="la-valora"
  data-api-url="https://chat.keyon.in"
  data-theme-color="#b4735a"
  data-title="La Valora"></script>

That's the whole integration. It mounts a floating launcher on load.

2. React package

npm install @keyon/chat-widget
import { KeyonChatEmbed } from "@keyon/chat-widget";

<KeyonChatEmbed
  project="la-valora"
  apiUrl="https://chat.keyon.in"
  themeColor="#b4735a"
  title="La Valora"
/>

Use KeyonChatEmbed (shadow DOM) unless you control the page's CSS entirely, in which case KeyonChat renders without the boundary.

Options

| Prop | data- attribute | Default | | |---|---|---|---| | project | data-project | — | Required. Project slug the backend knows. | | apiUrl | data-api-url | — | Required. Backend base URL. | | themeColor | data-theme-color | #b4735a | Brand accent. The rest of the palette is derived. | | textColor | data-text-color | auto | Text on the accent — header, launcher, visitor bubbles. Auto-picked for contrast if omitted. | | title | data-title | Chat with us | Header text. | | launcherLabel | data-launcher-label | Chat with us | Closed-state button label. | | placeholder | data-placeholder | Ask about the project… | Composer placeholder. | | position | data-position | bottom-right | or bottom-left. | | inline | data-inline | false | Render in page flow instead of floating. | | defaultOpen | data-default-open | false | Open on mount. | | theme | data-theme | light | light | dark | auto. | | radius | data-radius | 16 | Corner radius in px. | | target | data-target | appended to body | CSS selector to mount into. |

Programmatic mounting, for multiple instances or conditional loading:

const unmount = KeyonChat.mount({
  project: "la-valora",
  apiUrl: "https://chat.keyon.in",
  themeColor: "#2f6f4e",
  inline: true,
  target: "#chat-slot",
});

Two colours, not eight

You give themeColor; hover state and tinted bubbles are computed from it.

The text that sits on the accent is auto-picked by WCAG contrast rather than assumed to be white — a pale brand colour with white label text is the most common embed bug. That maths sometimes disagrees with a brand guideline (#1877f2 scores higher with black than white), so textColor overrides it. An override is always honoured; if it falls below 3:1 against the accent, or isn't valid hex, the widget warns in the console and carries on.

Style isolation

Everything renders inside a shadow root with all: initial on the host. Microsites ship global resets, * { box-sizing } rules, utility classes and !important overrides; without a hard boundary the widget inherits whatever the page does to button and input and looks broken on a site nobody tested against. demo/index.html deliberately forces Comic Sans and red dashed borders on every button and textarea to prove the boundary holds.

Backend requirements

The widget sends credentials: "include" so the session cookie round-trips and a conversation stays one thread. That requires the server to name the embedding origins explicitly — the CORS spec forbids wildcard-plus-credentials, and browsers drop the cookie silently rather than erroring:

CORS_ORIGINS=https://la-valora-hyderabad.com,https://another-microsite.in

Endpoints used: GET /greeting, POST /chat (SSE).

Development

npm install
npm run build          # dist/index.js, dist/index.cjs, dist/keyon-widget.js

python3 -m http.server 5500      # then open /demo/index.html

The demo points at http://127.0.0.1:8000; add http://127.0.0.1:5500 to CORS_ORIGINS on the backend.