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

@olotalk/widget

v0.2.0

Published

The [Olotalk](https://olotalk.com) AI chat widget — a Svelte 5 component that mounts a RAG-powered, multilingual chat assistant into any web page via Shadow DOM.

Readme

@olotalk/widget

The Olotalk AI chat widget — a Svelte 5 component that mounts a RAG-powered, multilingual chat assistant into any web page via Shadow DOM.

Most users should use @olotalk/widget-loader instead. It handles config fetching, browser compatibility, and dynamic loading with a single <script> tag. Use this package directly only if you need low-level control over widget instantiation.


Install

npm install @olotalk/widget

Usage

import { createWidget } from '@olotalk/widget'

const widget = createWidget(document.body, {
  widgetId: 'YOUR_WIDGET_ID',
  origin: 'https://api.olotalk.com',
  config: widgetConfig,   // fetched from /public/widgets/:id/config
  theme: 'light',
  placement: 'floating',
  cssUrl: 'https://cdn.jsdelivr.net/npm/@olotalk/widget/dist/olotalk-widget.css',
})

CSS

The widget loads its styles via a <link> injected inside the Shadow DOM. The CSS URL will be resolved automatically from the widget config in a future release. Until then, pass it explicitly via cssUrl or import the stylesheet manually:

import '@olotalk/widget/style.css'

createWidget(mount, options)

Mounts the widget into the given element and returns a WidgetInstance.

Options

| Option | Type | Required | Description | |---|---|---|---| | widgetId | string | Yes | Your widget ID. | | origin | string | Yes | Base URL of your Olotalk API. | | config | WidgetConfig | Yes | Widget configuration object from the API. | | theme | "light" | "dark" | object | No | Color scheme or custom theme overrides. | | placement | "floating" | "embedded" | No | Floating launcher or inline panel (default: "floating"). | | cssUrl | string | No | URL of the widget stylesheet. Will be resolved automatically from the widget config in a future release. | | locale | string | No | Force a display language: "en" | "fr" | "en-CA" | "fr-CA". |

WidgetConfig shape

This is returned by the Olotalk API at /public/widgets/:id/config.

type WidgetConfig = {
  tenantId: string
  widgetId: string
  displayName?: string
  theme?: Record<string, any>
  launcher?: {
    logoUrl?: string
    position?: 'bottom-right' | 'bottom-left'
    teaser?: {
      enabled?: boolean
      messages?: string[]
      delayMs?: number
      durationMs?: number
      cooldownMs?: number
      maxShowsPerSession?: number
    }
  }
  allowedDomains?: string[]
  features?: {
    domRagEnabled?: boolean
    siteRagEnabled?: boolean
    citationsEnabled?: boolean
    streamingEnabled?: boolean
  }
  security?: {
    rateLimitPer5Min?: number
    captchaMode?: boolean
  }
  privacy?: {
    piiRedaction?: boolean
    retentionDays?: number
  }
}

WidgetInstance API

widget.open()                          // Open the chat panel
widget.close()                         // Close the chat panel
widget.setTheme(theme)                 // Change theme at runtime
widget.destroy(opts?: { outro?: boolean }) // Unmount and remove from DOM

// Subscribe to events
widget.on('ready', ({ widgetId }) => { ... })
widget.on('open',  () => { ... })
widget.on('close', () => { ... })
widget.on('send',  ({ text }) => { ... })

Distribution files

| File | Format | Use case | |---|---|---| | dist/olotalk-widget.js | ESM | Dynamic import() from CDN or bundler | | dist/olotalk-widget.iife.js | IIFE | Legacy browsers (<script> tag, no module support) | | dist/olotalk-widget.css | CSS | Styles loaded inside the Shadow DOM | | dist/index.d.ts | TypeScript | Type definitions |


Features

  • RAG-powered answers — responses grounded in your website's knowledge base, not generic LLM output
  • Multilingualen and fr built-in (with en-CA / fr-CA variants); same-language retrieval with cross-language fallback
  • Streaming — real-time text generation for a conversational feel
  • Citations — optionally surfaces source URLs alongside answers
  • Proactive teasers — configurable delay-based messages to prompt engagement
  • Shadow DOM isolation — widget styles never bleed into the host page
  • Anonymous by default — no visitor login required
  • Domain whitelisting — control which sites can embed the widget
  • Privacy controls — optional PII redaction and configurable data retention

License

MIT © Olotalk