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

@kywi-software/js

v0.11.0

Published

Kywi CMS browser runtime — audience personalization, experiments, forms, and feed rendering for the public site (loaded as kywi.js).

Readme

@kywi-software/js

The Kywi CMS browser runtime — audience personalization (variant swaps, transparency badge), A/B experiment exposure/conversion beacons, the self-ID widget, and content-form hooks. It reads a small JSON context that @kywi-software/core's server-rendered pages embed in the page, then patches the DOM client-side. See the root README for how it fits into the rest of Kywi.

This package ships two builds from the same source (packages/kywi-js/src/index.ts):

  • dist/kywi.js — an IIFE bundle that exposes a Kywi global. This is the one Kywi CMS serves at the public URL /kywi.js (hence the package name).
  • dist/kywi.esm.js — an ES module, for bundler-based setups.

Install

npm install @kywi-software/js

Most projects don't install this directly — a Kywi CMS site (any deployment mode) serves the built bundle at /kywi.js automatically, and pages that need it load it with a plain <script> tag (see below). Install it directly if you're building a decoupled frontend and want to import it as an ES module instead.

Usage: script tag (how Kywi CMS itself loads it)

<script src="/kywi.js" data-kywi-js defer></script>

Kywi boots itself on DOMContentLoaded (or immediately if the document has already loaded) — reads its context from <meta name="kywi:*"> tags and data-kywi-* attributes that the server-rendered page embeds (site-id, theme-path, base-path, csrf-token, plus <html lang> and .kywi-edit-mode), patches personalization variants and the transparency badge into the DOM, and wires experiment exposure/conversion beacons and form hooks. No manual Kywi.boot() call needed for the default flow; use Kywi.preInit(fn) if you need to run code before boot.

Usage: ES module

import { Kywi } from '@kywi-software/js'

Kywi.preInit((kywi) => {
  // runs before boot — e.g. register a custom module via kywi.UI.extend(...)
})

What it does

  • Personalization: swaps display:none variant containers (data-kywi-variant) based on the visitor's resolved audience, and fills the transparency badge mount (data-kywi-personalization-badge) with an opt-in/opt-out control.
  • Experiments: confirms exposure of the server-rendered A/B variant and wires conversion signals (pageview, auto-emitted on boot; form-submit, auto-wired). The exported bootExperiments() (also usable standalone) returns an ExperimentRuntime with .track(eventName) / .trackConversion(signal) for custom conversions.
  • Self-ID widget: renders the audience self-identification UI (hello bar / modal / inline / drawer) authored in /admin/audiences/self-id-widget.
  • Feeds: Kywi.getFeed(type) / Kywi.renderFeed(options) for client-rendered content feeds.
  • Entities: Kywi.getEntity(type) — a thin fetch wrapper over the /api/v1 REST API, scoped with the page's CSRF token.

packages/kywi-js/src/index.ts and its tests (packages/kywi-js/src/__tests__/*.test.ts) are the source of truth for exact behavior.