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-loader

v0.2.0

Published

Embed the [Olotalk](https://olotalk.com) AI chat widget on any website with a single `<script>` tag — no framework required.

Readme

@olotalk/widget-loader

Embed the Olotalk AI chat widget on any website with a single <script> tag — no framework required.

The loader handles config fetching, browser compatibility detection, and dynamic loading of the widget bundle from the CDN. Your visitors get a grounded, RAG-powered chat assistant that answers questions based on your own content.


Quick start

<script
  src="https://cdn.jsdelivr.net/npm/@olotalk/widget-loader/dist/loader.iife.js"
  data-olotalk-widget-id="YOUR_WIDGET_ID"
  data-olotalk-origin="https://api.olotalk.com"
></script>

Paste this before </body> on any page. The widget appears immediately as a floating launcher in the bottom-right corner.

Get your widget ID from the Olotalk dashboard.


Configuration

Via HTML attributes

All attributes are read from the <script> tag itself.

| Attribute | Type | Description | |---|---|---| | data-olotalk-widget-id | string | Required. Your widget ID from the dashboard. | | data-olotalk-origin | string | Base URL of your Olotalk API (e.g. https://api.olotalk.com). Defaults to current page origin. | | data-olotalk-locale | string | Force a display language: "en", "fr", "en-CA", "fr-CA". Defaults to browser language. | | data-olotalk-cdn-base | string | Override the widget asset base URL (for self-hosting). |

Via window.OlotalkConfig

Declare a global config object before the loader script for programmatic setup:

<script>
  window.OlotalkConfig = {
    widgetId: "YOUR_WIDGET_ID",
    origin: "https://api.olotalk.com",
    locale: "fr",
    theme: "dark",
    placement: "embedded",
    mount: "#chat-container",
  };
</script>
<script src="https://cdn.jsdelivr.net/npm/@olotalk/widget-loader/dist/loader.iife.js"></script>

Full config reference

| Option | Type | Default | Description | |---|---|---|---| | widgetId | string | — | Required. Your widget ID. | | origin | string | window.location.origin | Base URL of your Olotalk API. | | locale | string | Browser language | Force language: "en" | "fr" | "en-CA" | "fr-CA". | | theme | "light" | "dark" | object | "light" | Color scheme or custom theme overrides. | | placement | "floating" | "embedded" | "floating" | Floating launcher button or inline panel. | | mount | string | document.body | CSS selector for the widget mount point (use with "embedded"). | | version | string | "latest" | Pin a specific @olotalk/widget npm version (e.g. "0.1.0"). | | cdnBase | string | jsDelivr CDN | Override widget asset base URL for self-hosting. | | cssUrl | string | Auto-resolved | Override the widget CSS URL. In a future release this will be provided automatically by the widget config from the dashboard. |


JavaScript API

The loader exposes a global Olotalk() command queue. You can call it before or after the script loads.

// Open or close the panel programmatically
Olotalk('open')
Olotalk('close')

// Re-initialize with a different config
Olotalk('init', { locale: 'fr' })

// Remove the widget from the page entirely
Olotalk('destroy')

Commands queued before the widget loads are replayed automatically once it is ready.


Version pinning

By default, the loader fetches the latest published version of @olotalk/widget from jsDelivr. To lock a specific version:

<!-- Pin widget bundle to a specific version -->
<script
  src="https://cdn.jsdelivr.net/npm/@olotalk/widget-loader/dist/loader.iife.js"
  data-olotalk-widget-id="YOUR_WIDGET_ID"
  data-olotalk-version="0.1.0"
></script>

Or pin the loader itself by version:

<script src="https://cdn.jsdelivr.net/npm/@olotalk/[email protected]/dist/loader.iife.js" ...></script>

Self-hosting

To serve widget assets from your own server instead of jsDelivr:

<script
  src="/path/to/loader.iife.js"
  data-olotalk-widget-id="YOUR_WIDGET_ID"
  data-olotalk-cdn-base="/assets/widget"
></script>

The loader will fetch olotalk-widget.js, olotalk-widget.iife.js, and olotalk-widget.css from the provided base URL.


npm install

If you are using a bundler or framework, you can import the loader directly:

npm install @olotalk/widget-loader
import { ensureWidget } from '@olotalk/widget-loader'

ensureWidget({
  widgetId: 'YOUR_WIDGET_ID',
  origin: 'https://api.olotalk.com',
})

License

MIT © Olotalk