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

@beeport/widget

v0.1.2

Published

BeePort feedback widget — npm package wrapper around CDN widget.js

Readme

@beeport/widget

BeePort feedback widget — npm package for programmatic installation.

Injects the same CDN-hosted widget as the <script> tag installation, but lets you control initialisation from your application code.

Installation

npm install @beeport/widget

Usage

Named imports (recommended — tree-shakeable)

import { init, destroy, open, close } from '@beeport/widget';

// Initialise the widget
init({ project: 'prj_abc123' });

// Programmatically open/close the feedback panel
open();
close();

// Remove all widget elements and reset (allows re-init)
destroy();

Namespace import

import BeeportWidget from '@beeport/widget';

BeeportWidget.init({ project: 'prj_abc123' });
BeeportWidget.open();
BeeportWidget.close();
BeeportWidget.destroy();

CommonJS

const { init, destroy, open, close } = require('@beeport/widget');
init({ project: 'prj_abc123' });

API

init(config)

Loads and initialises the BeePort widget by injecting the CDN script tag into document.body.

Idempotent — calling init() multiple times is safe; subsequent calls are no-ops.

Throws Error if called outside a browser environment (SSR guard).

init({
  project: 'prj_abc123',    // Required. Your project key.
  theme: 'auto',            // Optional. 'light' | 'dark' | 'auto'. Default: browser default.
  position: 'bottom-right', // Optional. 'bottom-right' | 'bottom-left'. Default: 'bottom-right'.
  accent: '#f3c744',        // Optional. CSS colour string. Default: BeePort gold.
  text: 'Feedback',         // Optional. Button label. Default: 'Feedback'.
});

destroy()

Removes all widget DOM elements (script tag, trigger button, iframe card, mobile sheet) and resets the loaded flag so init() can be called again.

Safe to call before init() or in non-browser environments (no-op).

open()

Programmatically opens the feedback panel by dispatching a beeport:open custom event on window.

Safe to call in non-browser environments (no-op).

close()

Programmatically closes the feedback panel by dispatching a beeport:close custom event on window.

Safe to call in non-browser environments (no-op).

TypeScript

Full TypeScript types are included. The BeePortConfig interface is exported for use in your own code:

import { init, type BeePortConfig } from '@beeport/widget';

const config: BeePortConfig = {
  project: 'prj_abc123',
  theme: 'dark',
};

init(config);

Framework examples

React

import { useEffect } from 'react';
import { init, destroy } from '@beeport/widget';

export function FeedbackWidget() {
  useEffect(() => {
    init({ project: 'prj_abc123', theme: 'auto' });
    return () => destroy();
  }, []);

  return null;
}

Vue

import { onMounted, onUnmounted } from 'vue';
import { init, destroy } from '@beeport/widget';

export function useFeedbackWidget(project: string) {
  onMounted(() => init({ project }));
  onUnmounted(() => destroy());
}

SSR

The package is SSR-safe. No window or document access occurs at import time — all browser APIs are only accessed inside function bodies. init() throws a descriptive error if called server-side; all other functions are silent no-ops.

Output formats

  • ESM (dist/index.js) — for bundlers and modern environments
  • CJS (dist/index.cjs) — for Node.js and legacy bundlers
  • Types (dist/index.d.ts) — TypeScript declarations

sideEffects: false is set in package.json for reliable tree-shaking.

Script tag alternative

If you don't use a bundler, load the widget directly from the CDN:

<script
  src="https://cdn.beeport.ai/widget.js"
  data-project="prj_abc123"
  data-theme="auto"
></script>