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

@supportwire/widget

v1.0.15

Published

SupportWire widget loader - embed the SupportWire chat widget on your site

Downloads

383

Readme

@supportwire/widget

Embed the SupportWire chat widget on your site. Load via script tag or ESM; configure theme, position, and optional JWT auth. Supports hidden trigger on launch, programmatic open/close, and sending messages.

Install

npm install @supportwire/widget

Usage

Option 1: Script tag (no bundler)

Load the IIFE build from a CDN, then create the widget with your config.

<script src="https://assets.supportwire.app/supportwire/widget-app-assets/loader/index.iife.js"></script>
<script>
  const widget = new (window.SupportWireWidget?.default ?? window.SupportWireWidget)({
    appUrl: 'https://your-widget-app.com',  // URL of your SupportWire widget app
    domain: 'your-org',
    widgetId: 'your-widget-id',
    theme: 'light',
    triggerPosition: 'bottom-right',
    widgetType: 'popup',
    userToken: 'optional-jwt-for-identified-users',
    onOpen: () => console.log('Opened'),
    onClose: () => console.log('Closed'),
    onError: (err) => console.error(err)
  });
</script>

Option 2: ESM (with a bundler)

import SupportWireWidget from '@supportwire/widget';

const widget = new SupportWireWidget({
  domain: 'your-org',
  widgetId: 'your-widget-id', // make it unique for each widget instance
  theme: 'light', // 'light' or 'dark'
  triggerPosition: 'bottom-right',
  widgetType: 'popup', // 'popup' or 'drawer' or 'center modal'
  userToken: 'optional-jwt', // JWT for identifying the user in the widget
  onOpen: () => {}, // Callback when the widget is opened
  onClose: () => {}, // Callback when the widget is closed
  onError: (err) => console.error(err) // Callback when the widget encounters an error
});

Config

| Option | Required | Description | |--------|----------|-------------| | appUrl | Yes (when using the npm build) | Base URL of the widget app (e.g. https://widget.supportwire.app) | | domain | Yes | Your organization slug | | widgetId | Yes | Your widget ID | | theme | No | 'light' or 'dark' (default: 'light') | | triggerPosition | No | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | | widgetType | No | 'popup' | 'drawer' | 'center modal' | | userToken | No | JWT for identifying the user in the widget | | hideOnLaunch | No | If true, the trigger is hidden on load. Use showTrigger() to show it, or open the widget via open() / sendMessage() — opening the widget also shows the trigger (default: false) | | selector | No | CSS selector for a custom trigger element (if not set, the default floating button is used) | | onOpen / onClose / onError | No | Callbacks |

API

Instance methods

  • widget.open() – open the widget
  • widget.close() – close the widget
  • widget.toggle() – open if closed, close if open
  • widget.showTrigger() – show the trigger (e.g. after hiding with hideOnLaunch)
  • widget.hideTrigger() – hide the trigger
  • widget.sendMessage(message, { openWidget?: boolean }) – send a message (markdown); opens the widget by default (and shows the trigger if hidden) unless { openWidget: false } is passed
  • widget.updateConfig(partialConfig) – update config at runtime
  • widget.destroy() – remove the widget from the page

Static methods

  • SupportWireWidget.getInstances(widgetId?) – returns all initialized widget instances; if widgetId is passed, only instances for that widget ID. Useful when multiple widgets exist or the constructor reference was not stored.