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

@browsez/widget

v0.1.2

Published

Embeddable BrowsEZ chat widget for SPA clients.

Readme

BrowsEZ Widget

Embeddable BrowsEZ chat widget for SPA clients. The first release is designed for Angular applications that install the package from the public npm registry and mount the widget once at the application root.

Distribution

Release 1 is public-npm-first. Client teams install @browsez/widget directly from npmjs.

Install:

pnpm add @browsez/widget
npm install @browsez/widget

CDN/script-tag distribution is intentionally deferred. The package still emits library builds, but the supported integration path for this release is package installation into the client app build.

Maintainer publish flow:

npm login
pnpm build
npm publish

Angular SPA Integration

Mount the widget once from the Angular app shell, such as the root component. Because the widget is root-mounted, it survives client-side route changes and only shows or hides itself based on the route rules.

import { Component, OnDestroy, OnInit } from '@angular/core';
import { embedWidget, type WidgetInstance } from '@browsez/widget';

@Component({
  selector: 'app-root',
  template: '<router-outlet />',
})
export class AppComponent implements OnInit, OnDestroy {
  private widget?: WidgetInstance;

  ngOnInit() {
    this.widget = embedWidget({
      platformApiBaseUrl: 'https://platform.example.com',
      demoAuth: {
        orgSlug: 'acme',
        username: 'demo-user',
        password: 'demo-password',
      },
      instanceId: 'inst_123',
      routes: {
        include: ['/dashboard/**', '/orders/**'],
        exclude: ['/login', '/checkout'],
      },
      history: {
        mode: 'drawer',
      },
    });
  }

  ngOnDestroy() {
    this.widget?.destroy();
  }
}

Route Rules

routes.include and routes.exclude accept simple path globs:

  • * matches one path segment.
  • ** matches across path segments.
  • exclude wins over include.
  • If include is omitted, the widget is visible by default unless excluded.

Examples:

routes: {
  include: ['/app/**'],
  exclude: ['/app/admin/**'],
}

Demo Auth

This demo release accepts static Platform credentials in the browser:

demoAuth: {
  orgSlug: 'acme',
  username: 'demo-user',
  password: 'demo-password',
}

The widget uses those credentials to sign in to the Platform, list the configured instance, and issue a playground token. Credentials, Platform sessions, and playground tokens are kept in memory only and are not written to local storage.

This is a demo-only auth contract. Production widget auth is expected to switch to a backend-mediated token exchange without changing the shared chat surface.

Lifecycle

Call destroy() when the host user logs out or when the embedding app needs to change user/workspace context. Recreate the widget with the new config after the host app has a new authenticated context.

this.widget?.destroy();
this.widget = embedWidget(nextConfig);

The widget API also supports:

widget.open();
widget.close();
widget.preload();
widget.sendMessage('Show me my orders');
widget.setInput('Help me understand this page');
widget.hide();
widget.show();

History Modes

history.mode supports three layouts:

  • hidden: no thread browser is shown.
  • drawer: the tray stays compact and exposes a "View threads" toggle that opens the Thesys thread sidebar.
  • sidebar: keeps the Thesys thread sidebar visible whenever the widget is open.