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

@appzgatenz/label-print-topbridge-js

v0.5.3

Published

Headless browser SDK for TopBridge label printing — WebSocket client, health, benefits, printers, templates, print

Readme

@appzgatenz/label-print-topbridge-js

Headless browser SDK for TopBridge label printing. WebSocket API V2 client, health check, login status, benefits, printers, template schema, and print execution — zero dependencies.

Install

npm install @appzgatenz/label-print-topbridge-js

Quick Start

import { TopBridgeClient } from '@appzgatenz/label-print-topbridge-js'

const client = new TopBridgeClient({ debug: true })

// 1. Preflight
const { printers } = await client.preflight.run()

// 2. Print
const result = await client.print.execute({
  template: 'PRICE_LABEL',
  printer: printers.data.defaultPrinter,
  products: [
    { name: 'Apple', examplePrice: { value: 3.99, currency: '$', unit: '/kg' }, copies: 2 },
  ],
})

console.log(`Printed ${result.data.printedCopies} copies`)

Documentation

Architecture

TopBridgeClient
├── health        Health check
├── whoami        Login status
├── benefits      Print quota verification
├── printers      Printer list
├── templates     Template list + schema
├── print         Print execution with data transformation
├── preflight     Orchestrated health → benefits → printers
├── launch        Tray App launch + retry orchestration
├── printerSetup  Printer config + BPAC setup
└── events        Push events + connection lifecycle

Features

  • Zero dependencies — pure TypeScript, browser-native APIs only
  • ~8.6 KB gzipped — minimal bundle size
  • TypeScript strict mode — full type safety with exported types
  • Headless — no UI framework dependency, works with React/Vue/Svelte/vanilla
  • Layered error modelinstanceof type narrowing for all error scenarios
  • ESM + CJS — compatible with Vite, Next.js, webpack
  • WebSocket API V2 — unified /v2 endpoint with action-based requests
  • Realtime events — persistent connection with printer/template/user push events + connection lifecycle

Security

  • Fixed SDK endpoints (ws://localhost:8765 by default, optional wss://topbridge.topsale.co.nz:8764 via wssEnabled: true) — no arbitrary URL configuration
  • SDK caller source whitelist (Core-SDK / React-SDK / Nextjs-SDK; Excel / Odoo are Tray App integration sources outside this core package)
  • Production build minification
  • URL safety validation
  • Input sanitization (formula injection prevention)

License

MIT