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

@gagandeep023/support-chat-widget

v0.1.3

Published

Embeddable support chat widget: headless client, web component, and React wrapper.

Readme

@gagandeep023/support-chat-widget

The customer-facing end of support-chat. One client, three ways to mount it: a web component for any page, a React wrapper, or headless if you are drawing your own UI.

npm i @gagandeep023/support-chat-widget

react is an optional peer, so the web component and the headless client cost you nothing if you are not on React.

Plain HTML

<script src="/support-chat/widget.js"></script>
<support-chat publishable-key="pk_live_..."></support-chat>

The publishable key identifies the tenant and nothing more. For logged-in users, sign their id on your server and pass the hash, so nobody can claim to be somebody else.

React

import { SupportChat } from "@gagandeep023/support-chat-widget/react";

<SupportChat
  publishableKey="pk_live_..."
  userId={user.id}
  userHash={hash}
/>;

Or take the hook and draw it yourself:

import { useSupportChat }
  from "@gagandeep023/support-chat-widget/react";

const { state, messages, send, connection } =
  useSupportChat({ publishableKey });

Headless

import { SupportChatClient, socketIoTransport }
  from "@gagandeep023/support-chat-widget";

const client = new SupportChatClient({
  publishableKey,
  transport: socketIoTransport,
});

SupportChatClient holds the whole conversation state machine: connection state, message list, streaming replies, escalation, and tool-approval prompts. Every rendering layer above is a thin shell over it, so behaviour cannot drift between them.

Entry points

| Import | Gives you | | --- | --- | | @gagandeep023/support-chat-widget | SupportChatClient, transports, WIDGET_STYLES | | .../element | SupportChatElement, the <support-chat> custom element | | .../react | SupportChat component and useSupportChat hook | | .../browser | prebuilt bundle for a <script> tag |

Transports

socketIoTransport is the default, and Transport / TransportFactory are exported so the client can be driven by something else entirely, including a fake in tests. The client does not import socket.io directly; it is handed a transport.

Reconnecting

Backoff comes from support-chat-core, shared with the server, rather than from a timer in this package. When a deploy drains every socket at once, the server says when to come back and the delay is spread across clients, so the herd does not arrive together.


The rest of support-chat

| Package | What it is | | --- | --- | | @gagandeep023/support-chat-core | Types, wire protocol, reconnect backoff | | @gagandeep023/support-chat-server | The engine: socket gateway, retrieval, routing, host tools, stores | | @gagandeep023/support-chat-widget | Customer-facing chat: web component, React, or headless | | @gagandeep023/support-chat-agent-console | Agent side, as a React component for your dashboard | | @gagandeep023/support-chat-cli | dev, doctor, eval |

The repository README is the full walkthrough, and DESIGN.md records what was rejected and why.

Requests and feedback

Request a feature Report a bug

Ideas and questions go to Discussions, bugs to Issues.

License

MIT