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

site-context-chat

v5.4.1

Published

AI website chat that answers from your own knowledge base: React widget, admin panel, script-tag embed. Runs on your own Supabase backend (Claude, OpenAI or Z.ai).

Readme

site-context-chat

An AI website chat that answers your visitors from your own knowledge base: services, prices, opening hours, FAQs, in plain Markdown. When it can't help, it offers to pass on an enquiry.

This package is the client: the chat widget, the chat admin panel, a script-tag embed and a small CLI. The answers come from a backend on your own Supabase project, with your own AI key (Claude, OpenAI or Z.ai GLM).

  • Using Kontor? Your Kontor backend already runs the chat. Use your project URL and publishable key from Kontor (Settings → Visitor chat → Website embed).
  • Without Kontor: download the free chat backend (two functions, the database script and a setup guide) from getkontor.eu/support-software or the GitHub releases.

Also available as a WordPress plugin.

Install

npm install site-context-chat @supabase/supabase-js

React 18 or newer. ES modules only.

The chat widget

import { ChatbotProvider } from 'site-context-chat';
import { SiteChatWidget } from 'site-context-chat/widget';
import 'site-context-chat/styles.css';

export function AppShell({ children }) {
  return (
    <ChatbotProvider
      supabaseUrl={process.env.NEXT_PUBLIC_SUPABASE_URL}
      supabaseAnonKey={process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY}
      siteId="default"
    >
      {children}
      <SiteChatWidget routePath={typeof window !== 'undefined' ? window.location.pathname : '/'} />
    </ChatbotProvider>
  );
}

supabaseAnonKey takes your project's publishable key (sb_publishable_…) or the legacy anon key. Both are public by design. Never put the service or secret key in a website.

Optional widget props: hideFabWhenSelector (hide the chat button while an element is on screen), aiPrivacyNotice, proactiveNudge, inline (render inside a container instead of floating).

The chat admin (private route)

import { AdminPanel } from 'site-context-chat/admin';
import 'site-context-chat/styles.css';

export default function ChatAdminPage() {
  return (
    <AdminPanel
      supabaseUrl={process.env.NEXT_PUBLIC_SUPABASE_URL}
      supabaseAnonKey={process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY}
      siteId="default"
    />
  );
}

Unlock it with your backend's admin secret (SITE_CHAT_ADMIN_SECRET), then set the chat's name and model, paste your knowledge base, and read conversations and enquiries. To keep the secret out of the browser, pass it from your own server-side auth as adminCredential.

Script-tag embed (any HTML site)

The package ships a self-contained build that includes React: node_modules/site-context-chat/dist/embed/site-context-chat-embed.js and .css. (Or download the embed kit from the releases.) Host the two files, then:

<script>
  window.SiteContextChatConfig = {
    supabaseUrl: 'https://YOUR_PROJECT.supabase.co',
    supabaseAnonKey: 'YOUR_PUBLISHABLE_KEY',
    siteId: 'default',
  };
</script>
<link rel="stylesheet" href="/path/to/site-context-chat-embed.css" />
<script src="/path/to/site-context-chat-embed.js"></script>

API: window.SiteContextChat.mount(config?) / window.SiteContextChat.unmount(). Set manual: true in the config to skip the automatic mount.

Turn your docs into a knowledge base

npx site-context-chat export ./docs ./context.md

Bundles a folder of Markdown files into one document. Paste it into the admin's Context tab.

Backend API (for reference)

The widget talks to one function, site-chat (actions config, history, chat with streaming, submitInquiry); the admin panel to site-chat-admin (actions get, save, conversations, conversation, inquiries, with the x-admin-secret header). Both come with the free backend and with every Kontor backend.

Licence

MIT. Made by TechLads for Kontor.