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

@opiniom/web

v0.6.0

Published

Embeddable chat widget web component — Shadow DOM isolated, themeable, works with any framework

Downloads

45

Readme

@opiniom/web

Lit-based web component chat widget for OpinioM. Renders in a Shadow DOM for full style isolation — drop it into any page without CSS conflicts.

Install

npm install @opiniom/web @opiniom/core @opiniom/types

Quick Start

import { createClient } from "@opiniom/core";
import { mount } from "@opiniom/web";

const client = await createClient({
  projectKey: "pk_live_abc123",
  jwt: customerSignedJwt,
});

const widget = mount({ client });

A floating chat bubble appears in the bottom-right corner. Click it to open the chat panel.

Mount Options

const widget = mount({
  client: opiniomClient,         // Required - from @opiniom/core
  widgetConfig: config,          // Optional - override server config
  mode: "floating",              // "floating" (default) | "inline"
  container: "#chat-container",  // Required when mode is "inline"
  theme: {                       // Optional runtime theme overrides
    bubbleBgSelf: "#6366f1",
    cssVars: {
      "--om-primary": "#6366f1",
    },
  },
});

Mounted Widget API

// Remove the widget from the page
widget.unmount();

// Update theme at runtime
widget.setTheme({
  bubbleBgSelf: "#10b981",
  cssVars: { "--om-primary": "#10b981" },
});

Inline Mode

Embed the chat directly inside a container element:

<div id="chat-container" style="height: 600px;"></div>

<script type="module">
  import { createClient } from "@opiniom/core";
  import { mount } from "@opiniom/web";

  const client = await createClient({
    projectKey: "pk_live_abc123",
    jwt: token,
    mode: "inline",
  });

  mount({
    client,
    mode: "inline",
    container: "#chat-container",
  });
</script>

CDN Usage

Load directly from the CDN without a bundler:

<script type="module">
  import { createClient } from "https://cdn.example.com/v1/opiniom-core.es.js";
  import { mount } from "https://cdn.example.com/v1/opiniom-web.es.js";

  const client = await createClient({
    projectKey: "pk_live_abc123",
    jwt: "your-jwt-token",
  });

  mount({ client });
</script>

Components

The widget is composed of these Lit web components (all rendered in Shadow DOM):

| Component | Description | |---|---| | om-app | Root container | | om-launcher | Floating chat bubble button | | om-panel | Chat window | | om-header | Panel title bar with close button | | om-conversation-list | List of conversations | | om-thread | Message list with scroll and pagination | | om-message | Individual message with reactions and attachments | | om-composer | Message input with file upload |

Theming

The widget reads theme configuration from your OpinioM dashboard (colors, fonts, layout). Override at runtime:

widget.setTheme({
  cssVars: {
    "--om-primary": "#6366f1",
    "--om-bg-panel": "#1a1a2e",
    "--om-text-primary": "#ffffff",
    "--om-radius": "12px",
  },
});

Style Isolation

The widget renders inside a Shadow DOM, so your page's CSS won't affect it and it won't affect your page. No class name conflicts, no specificity wars.

Bundle Size

| Format | Size (gzip) | |---|---| | ESM | ~19 KB |

Related Packages

| Package | Description | |---|---| | @opiniom/core | Framework-agnostic core client | | @opiniom/react | React provider, hooks, and components | | @opiniom/types | TypeScript type definitions |

License

MIT