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

@kanhaiyamark/kriyaos-chat-widget

v1.0.27

Published

Embeddable KriyaOS chat widget for websites and web apps.

Readme

KriyaOS Chat Widget

Production-ready embeddable chat widget for websites and web apps.

Package: @kanhaiyamark/kriyaos-chat-widget

Features

  • Lightweight ESM and CJS bundles
  • Session persistence with localStorage
  • Quick action chips for faster conversations
  • Typing animation and streaming response support
  • KriyaOS API support via workspaceId and agentId
  • Works with plain HTML, React, and Next.js client components

Installation

Install from npm:

npm install @kanhaiyamark/kriyaos-chat-widget

Quick Start

To use the default chatbot launcher icon, place your GIF at public/assets/kriyaos-chat-wadget.gif. You can override it any time with theme.logoUrl.

Plain HTML / Vanilla JS

<script type="module">
  import ChatWidget from "@kanhaiyamark/kriyaos-chat-widget";

  ChatWidget.init({
    workspaceId: "your-workspace-id",
    agentId: "your-agent-id",
    title: "Support Assistant",
    theme: {
      primaryColor: "#0f766e",
      logoUrl: "https://app.kriyaos.com/favicon.ico",
      welcomeMessage: "Hi! Ask me anything.",
      fontSizeMode: "small"
    }
  });
</script>

React

import { useEffect } from "react";
import ChatWidget from "@kanhaiyamark/kriyaos-chat-widget";

export default function App() {
  useEffect(() => {
    ChatWidget.init({
      workspaceId: "your-workspace-id",
      agentId: "your-agent-id"
    });
  }, []);

  return null;
}

Next.js (App Router)

Use this only in a client component because the widget uses window, document, and localStorage.

"use client";

import { useEffect } from "react";
import ChatWidget from "@kanhaiyamark/kriyaos-chat-widget";

export default function ChatWidgetLoader() {
  useEffect(() => {
    ChatWidget.init({
      workspaceId: "your-workspace-id",
      agentId: "your-agent-id"
    });
  }, []);

  return null;
}

API

Call:

ChatWidget.init(config)

Config Reference

| Field | Type | Required | Description | |---|---|---|---| | workspaceId | string | Yes | KriyaOS workspace id | | agentId | string | Yes | KriyaOS agent id | | apiBaseUrl | string | No | Base URL for KriyaOS API | | headers | Record<string, string> | No | Additional request headers | | storageKey | string | No | Namespace seed for localStorage keys | | title | string | No | Header title in widget | | quickActions | string[] | No | Starter quick-action chips | | theme.primaryColor | string | No | Primary color (hex or gradient) | | theme.logoUrl | string | No | Logo URL shown in widget header | | theme.welcomeMessage | string | No | First assistant message | | theme.fontSizeMode | "small" | "medium" | "large" | No | UI text scaling |

You can get workspaceId and agentId from your KriyaOS workspace dashboard.

Request and Response Formats

KriyaOS format

Request body:

{
  "messages": [
    {
      "role": "user",
      "parts": [{ "type": "text", "text": "Hello" }]
    }
  ]
}

Expected response shape:

{
  "message": {
    "parts": [{ "type": "text", "text": "Hi, how can I help?" }]
  },
  "session": { "id": "session-id" }
}

Streaming (SSE) is supported using text/event-stream.

Production Notes

  • Initialize the widget once per page load
  • Always run in browser context only
  • Configure CORS allow-list for your frontend origin
  • Use HTTPS endpoints in production
  • If your backend requires auth, pass headers in config

Troubleshooting

  • CORS error in widget: allow your website origin on API side
  • Nothing appears after install in Next.js: confirm component has "use client"
  • Duplicate widgets: ensure init is called only once

License

MIT

Author

KriyaOS

Website: https://www.kriyaos.com/