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

@bidkernel/analytics

v0.34.0

Published

Bidkernel auction analytics: a standalone Prebid.js analytics adapter, plus TypeScript bindings for the Bidkernel ad SDK.

Readme

@bidkernel/analytics

Vanilla JS bindings, TypeScript types, and standalone Prebid.js analytics adapter for Bidkernel.

Collects Prebid auction telemetry (auctions, bid requests/responses, wins, timeouts, no-bids, render failures), batches events into protobuf payloads, and delivers them to the property ingest endpoint via sendBeacon on page hide with automatic retry backoff.

Install

npm install @bidkernel/analytics

Standalone bundle (self-hosted, zero external bandwidth cost):

curl -Lo bidkernel-analytics.js https://unpkg.com/@bidkernel/analytics/dist/analytics.global.js
<script async src="/js/bidkernel-analytics.js"></script>

The standalone bundle is also exposed via ./standalone: import "@bidkernel/analytics/standalone". Defaults endpoint to production ingest (https://by.bidkernel.io/t); custom domains must specify endpoint via config.

Usage with Prebid.js

Register as a standard Prebid analytics provider:

import { registerPrebidAnalytics } from "@bidkernel/analytics";

registerPrebidAnalytics("pbjs", { endpoint: "https://by.bidkernel.io/t" });

pbjs.que.push(function () {
  pbjs.enableAnalytics([{ provider: "bidkernel", options: { propertyId: "YOUR_PROPERTY_ID" } }]);
});

If loaded after auctions start, the adapter replays pbjs.getEvents() history. Events deduplicate across the replay/live boundary.

Direct instantiation without enableAnalytics:

import { BidkernelPrebidAnalytics } from "@bidkernel/analytics";

const analytics = new BidkernelPrebidAnalytics({
  endpoint: "https://by.bidkernel.io/t",
  propertyId: "YOUR_PROPERTY_ID",
});
analytics.enable();

Configuration

| Option | Default | Description | | ----------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | endpoint | - | Ingest base URL ({endpoint}/{propertyId}). Standalone bundle defaults to https://by.bidkernel.io/t. Must be an absolute https:// URL (or loopback http://). Invalid endpoints fail closed. First registration pins ingest origin; subsequent calls cannot redirect across origins. | | propertyId | - | Bidkernel property ID. | | pbjsGlobalName | "pbjs" | Window global holding the Prebid instance. | | attachPbjsListeners | true | Set false when feeding events manually via trackRawEvent. | | auctionEnabled | true | Collect auction lifecycle events. | | warningsEnabled | true | Collect warning events. | | userId | "" | User identifier. Not auto-generated; see User identity. | | sessionId / pageviewId | generated | Override identity; defaults to managed 30-minute visitor sessions. See Sessions. | | deviceType / country / region | server-derived | Optional client hints; resolved server-side. | | logLevel | "INFO" | Console log verbosity (DEBUG, INFO, WARN, ERROR). |

SPA route transitions: call analytics.navigate(newPageviewId, newUrl) to flush the previous pageview and reset session timing.

Sessions

A session is a 30-minute window of visitor activity. It starts with a pageview and extends on user interaction (pointerdown, keydown, scroll, touch, tab visibility). Ad events do not extend sessions; idle tabs stop refreshing 30 minutes after last user interaction. Subsequent interaction mints a new sessionId.

The adapter reports events regardless of session state. The Bidkernel SDK uses isSessionActive() and onSessionResume(listener) to halt refreshes when inactive.

Explicit sessionId values are never rotated.

User identity

The adapter never auto-generates userId. Without an explicit ID, warehouse events record a NULL user_id.

Supply a stable first-party identifier (e.g. cookie UUID, never PII) when enabling analytics:

pbjs.enableAnalytics([
  {
    provider: "bidkernel",
    options: {
      propertyId: "YOUR_PROPERTY_ID",
      userId: getOrCreateFirstPartyUserId(),
    },
  },
]);

Or set post-consent on an instance:

analytics.setUserId(userId);

Batches stamp userId at send time; set as early as possible.

Releasing

Publishing is automated by .github/workflows/packages.yml. Pushes to main publish to npm only when version in package.json changes.

For user-visible changes:

  1. Bump version in package.json (semver).
  2. Add matching entry in CHANGELOG.md.

Bidkernel SDK bindings

getbidkernel() returns the typed window.bidkernel command queue stub (initializing if missing), exposing SlotConfig and AdsGlobal interfaces:

import { getbidkernel } from "@bidkernel/analytics";

getbidkernel().q.push(() => {
  // SDK ready
});