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

chatcraft-bot

v1.0.0

Published

ChatCraft embeddable chatbot widget for React and npm-based frameworks.

Readme

chatcraft-bot

Official ChatCraft npm package for embedding your chatbot in React and npm-based web frameworks.

Install

npm install chatcraft-bot

Features

  • Same widget behavior as ChatCraft script-tag embed
  • Public config loading with deployed-only guard
  • Theme, icon, chatbot name, font family, user/bot text colors
  • Google Fonts dynamic loading (supports Customization font selection)
  • Streaming chat responses (SSE) with typing bubble
  • Markdown rendering for bold, lists, links, and tables
  • Source/link cleanup in client response text
  • Slide-up chat panel animation
  • React component and hook APIs
  • Framework-agnostic core for any npm app

React Usage

import { ChatCraftBot } from "chatcraft-bot/react";

export default function App() {
  return (
    <>
      <main>Your website content</main>
      <ChatCraftBot
        projectId="YOUR_PROJECT_ID"
        apiBase="http://localhost:8080/api/v1"
      />
    </>
  );
}

Next.js Usage

"use client";

import dynamic from "next/dynamic";

const ChatCraftBot = dynamic(
  () => import("chatcraft-bot/react").then((m) => m.ChatCraftBot),
  { ssr: false },
);

export default function ClientWidget() {
  return (
    <ChatCraftBot
      projectId="YOUR_PROJECT_ID"
      apiBase="https://your-backend-domain/api/v1"
    />
  );
}

Hook Usage

import { useChatCraftBot } from "chatcraft-bot/react";

export default function App() {
  useChatCraftBot({
    projectId: "YOUR_PROJECT_ID",
    apiBase: "http://localhost:8080/api/v1",
  });

  return <main>Website</main>;
}

Framework-Agnostic Usage (Vanilla / Any npm app)

import { createChatCraftWidget } from "chatcraft-bot";

const widget = createChatCraftWidget({
  projectId: "YOUR_PROJECT_ID",
  apiBase: "http://localhost:8080/api/v1",
});

widget.mount();

// Optional controls
// widget.open();
// widget.close();
// widget.toggle();
// widget.destroy();

API

createChatCraftWidget(options)

Returns a widget instance with:

  • mount(): Promise<void>
  • destroy(): void
  • open(): void
  • close(): void
  • toggle(): void
  • isMounted(): boolean

ChatCraftBot props

  • projectId (required)
  • apiBase (default: <current-origin>/api/v1)
  • mountTarget (default: document.body)
  • position (bottom-right or bottom-left)
  • zIndex
  • sessionId
  • greeting
  • autoOpen
  • onError
  • enabled (React only)

Deploy-state behavior

If a bot is in draft mode, /embed/config/{project_id} returns forbidden and the widget will not mount.

Security notes

  • The widget renders markdown through controlled DOM node creation (no unsafe HTML injection).
  • Inline source URLs and source markers are stripped from bot response text in the client.
  • Public config and chat calls are made only to your provided apiBase.

Publish to npm

From this folder:

npm login
npm run build
npm publish --access public

Use package name:

chatcraft-bot

If npm says the version already exists, bump version in package.json and publish again.