# pubkey/broadcast-channel

:satellite: BroadcastChannel to send data between different browser-tabs or nodejs-processes :satellite: + LeaderElection over the channels  https://pubkey.github.io/broadcast-channel/

Repository: https://github.com/pubkey/broadcast-channel
Canonical: https://ross.abutalabs.com/products/broadcast-channel
Homepage: https://pubkey.github.io/broadcast-channel/
Language: JavaScript
License: MIT
License Family: permissive
Topics: crosstab, broadcast-channel, broadcast, polyfill, indexeddb, localstorage, ipc, postmessage, communication-channel, leader-election, messaging, offline, shim, stream, channels, cookie, localforage, broker, client-side, shared
Last push: 2026-08-26T20:58:30+00:00

## Health v2 (maintenance only)
Score: 83/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 54, longevity 100
- inputs: {"age_days": 3013, "days_push": 7, "days_rel": 225, "gap_med": 85, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1997, forks 132 (observed 2026-08-28T04:06:03.588757+00:00)

## What it is
A JavaScript library implementing the BroadcastChannel API across browsers, WebWorkers, Node.js, and Deno, enabling message passing between browser tabs or Node.js processes. It also provides leader election over the channels so only one tab/process acts as the leader.

## Use cases
- sync state between browser tabs
- send messages between nodejs processes
- elect a leader tab among open tabs
- polyfill broadcastchannel for old browsers
- communicate with web workers
- cross-tab logout or session sync

## When to choose
- you need cross-tab or cross-process messaging that works in older browsers and runtimes
- you need leader election across tabs or processes
- you want a runtime-agnostic BroadcastChannel with fallbacks like IndexedDB or localStorage

## When to avoid
- you only target modern browsers with native BroadcastChannel support and need no fallbacks
- you need durable or persistent message delivery rather than ephemeral broadcast
- you need inter-server or networked messaging rather than same-origin client-side communication

## Facets
- artifact type: library
- maturity: active
- function: message-queue, middleware
- domain: web-development, frontend, cross-platform
- platform: browser, cross-platform
- tags: broadcast-channel, cross-tab-communication, leader-election, polyfill, ipc, postmessage, indexeddb, localstorage, web-workers, messaging, nodejs, deno

## Member repositories
- pubkey/broadcast-channel (main) score 83

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:03.588757+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:02:17.029111+00:00, confidence not recorded.
  - readme: https://github.com/pubkey/broadcast-channel (fetched 2026-08-28T04:06:03.588757+00:00, sha a93b7e5e56b1)
  - homepage: https://pubkey.github.io/broadcast-channel/ (fetched 2026-08-29T10:42:18.728223+00:00, sha 0291b1b981e5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
