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

@trillboards/connect

v1.1.2

Published

Zero-friction DOOH partner SDK — monetize vending machines, kiosks, and digital signage with ads in one line of code. MCP server compatible.

Readme

@trillboards/connect

Zero-friction partner onboarding SDK for digital signage ad monetization. One init() call handles device registration, ad fetching, rendering, offline caching, and analytics.

Installation

npm install @trillboards/connect

Or via CDN:

<script src="https://unpkg.com/@trillboards/connect/dist/trillboards-connect.global.js"></script>

Quick Start

const TrillboardsConnect = require('@trillboards/connect');
// or: import TrillboardsConnect from '@trillboards/connect';

const trillboards = TrillboardsConnect.init({
  apiKey: 'trb_partner_xxx',
  deviceId: 'my-screen-001',
  containerId: 'ad-container',
  options: {
    heartbeatInterval: 60000,
    adInterval: 60,
    muted: true,
    offlineCache: true,
    analytics: true,
  },
});

trillboards.on('ready', (data) => {
  console.log('SDK ready:', data.fingerprint);
});

trillboards.on('ad_start', (data) => {
  console.log('Ad started:', data.ad.id);
});

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Partner API key (trb_partner_xxx) | | deviceId | string | required | Unique device identifier | | containerId | string \| HTMLElement | null | DOM container for ad rendering | | options.heartbeatInterval | number | 60000 | Heartbeat interval in ms | | options.adInterval | number | 60 | Ad rotation interval in seconds | | options.muted | boolean | true | Start video ads muted | | options.offlineCache | boolean | true | Enable IndexedDB offline caching | | options.analytics | boolean | true | Enable analytics event buffering | | options.deviceType | string | 'digital_signage' | Device type for registration | | options.deviceName | string | 'SDK Device: <deviceId>' | Friendly device name | | options.display | object | auto-detected | Display specs { width, height } | | options.location | object | {} | Location { lat, lng, address, venue_type } | | options.metadata | object | {} | Custom metadata sent with registration | | options.objectFit | string | 'cover' | CSS object-fit for ad rendering |

Events

| Event | Data | Description | |-------|------|-------------| | ready | { deviceId, fingerprint, screenId, embedUrl } | SDK fully initialized | | device_registered | { fingerprint, screen_id, embed_url } | Device registered with API | | device_status | { from, to, deviceId } | Device status changed | | ad_start | { ad, type, timestamp } | Ad started rendering | | ad_complete | { ad, type, duration, completed } | Ad finished rendering | | ad_error | { ad, type, error } | Ad rendering error | | impression | { ad, result, totalImpressions } | Impression tracked | | heartbeat | { beat, status, timestamp } | Heartbeat sent | | heartbeat_error | { error, consecutiveFailures, willRetry } | Heartbeat failed | | sync_complete | { total, synced, failed } | Offline impressions synced | | connectivity_change | { online } | Online/offline status changed | | analytics_flush | { flushed, errors } | Analytics buffer flushed | | socket_connected | { socketId } | Socket.io connected | | socket_disconnected | { reason } | Socket.io disconnected | | config_updated | { config, source } | Config updated via socket | | error | { phase, error, fatal? } | General error |

API

TrillboardsConnect.init(config)

Initialize the SDK. Returns a ConnectInstance that begins initialization asynchronously.

TrillboardsConnect.create(config)

Create an uninitialized instance for advanced use cases. Call instance.initialize() manually.

Instance Methods

| Method | Description | |--------|-------------| | on(event, callback) | Register an event listener | | off(event, callback) | Remove an event listener | | nextAd() | Skip to the next ad | | pause() | Pause ad rotation | | resume() | Resume ad rotation | | getState() | Get complete SDK state | | queueOfflineImpression(data) | Queue an impression for offline sync | | syncOffline() | Force sync offline impressions | | cacheAdsOffline(ads) | Cache ads for offline playback | | destroy() | Clean up all resources |

Sub-Modules

For advanced usage, sub-modules are exposed directly:

  • TrillboardsConnect.device — Registration, fingerprinting, heartbeat
  • TrillboardsConnect.auction — Ad fetching, rendering, VAST parsing
  • TrillboardsConnect.offline — IndexedDB caching and impression queue
  • TrillboardsConnect.branding — CSS injection and white-labeling
  • TrillboardsConnect.analytics — Event buffering and batch sending

License

MIT