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

nivq-chat-widget

v1.0.2

Published

Embeddable NivQ chat web component (<nivq-chat>) for any website or framework.

Readme

nivq-chat-widget

Embeddable NivQ chat experience as a framework-agnostic Web Component (<nivq-chat>). Drop it into any site — plain HTML, React, Angular, Vue — with one tag and get the NivQ chat UI in a floating launcher (FAB) or inline panel.

  • Style-isolated — renders in a Shadow DOM; no CSS bleed in either direction.
  • Secret-safe — never touches your OAuth2 clientSecret; it uses a short-lived token from your own token-broker endpoint (see below).
  • Themeable — defaults to the NivQ brand; override palette, logo, radius.
  • Lazy charts — the Vega rendering stack loads only when a turn returns a chart.

Quick start

Via CDN (jsDelivr) — no build step:

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/nivq-chat-widget@1/dist/nivq-chat.js"
></script>
<nivq-chat agent-id="YOUR_AGENT_ID" api-base-url="https://api.nivq.ai" token-endpoint="/nivq-token">
</nivq-chat>

Or via npm (bundlers / React / Angular):

npm i nivq-chat-widget
import "nivq-chat-widget"; // registers <nivq-chat>; ships its own types

Pin the major (@1) for automatic patches without breaking changes.

Token broker (required)

The widget authenticates with a short-lived bearer token, never your clientSecret. Stand up one small endpoint on your backend that exchanges your NivQ credentials for a token and returns only { access_token, expires_in }:

// POST /nivq-token  (your backend) — authenticate YOUR user first, then:
const r = await fetch(`${process.env.NIVQ_API_BASE}/oauth2/token`, {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams({
    grant_type: "client_credentials",
    client_id: process.env.NIVQ_CLIENT_ID,
    client_secret: process.env.NIVQ_CLIENT_SECRET, // stays server-side
  }),
});
const { access_token, expires_in } = await r.json();
res.json({ access_token, expires_in }); // never return the secret

The widget calls POST {token-endpoint}, caches the token, and refreshes it before expiry. Full Node/Spring examples, the CORS allow-list step, and the privacy notes are in docs/integration.md (shipped in the package).

CORS: the widget streams straight from the browser to api-base-url, so add the origin(s) you embed on to the API key's Allowed origins when you create it.

Configuration

| Attribute | Required | Default | Description | | ------------------ | -------- | -------------- | -------------------------------------------------------- | | agent-id | ✅ | — | The NivQ agent to chat with | | token-endpoint | ✅ | — | Your token broker URL | | api-base-url | ✅ | — | NivQ chat API base (e.g. https://api.nivq.ai) | | mode | | fab | fab (floating launcher) or inline | | target | | — | Inline only: CSS selector of the container to mount into | | position | | bottom-right | bottom-right or bottom-left (FAB) | | theme | | auto | light, dark, or auto (follows OS) | | locale | | auto | tr, en, or auto (browser language) | | primary-color | | NivQ red | Hex (#6d28d9) or HSL triplet (265 70% 50%) | | accent-color | | NivQ | Hex or HSL triplet | | radius | | 0.625rem | Corner radius (any CSS length) | | logo-url | | NivQ mark | Replace the brand logo | | brand-name | | NivQ | Header title / logo alt text | | launcher-label | | — | Text next to the FAB icon | | greeting | | — | Custom empty-state heading | | placeholder | | localized | Input placeholder text | | title | | localized | Panel header title | | external-user-id | | — | Distinguishes your end-user | | persist | | false | Persist the conversation in localStorage | | start-open | | false | FAB only: open the panel on load |

Programmatic config:

document.querySelector("nivq-chat").configure({
  primaryColor: "#6d28d9",
  brandName: "Acme Assistant",
  mode: "inline",
});

License

UNLICENSED — © Nivorbit. See https://nivq.ai.