# lukeed/sockette

The cutest little WebSocket wrapper! 🧦

Repository: https://github.com/lukeed/sockette
Canonical: https://ross.abutalabs.com/products/sockette
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2024-01-20T17:07:08+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3316, "days_push": 956, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2468, forks 79 (observed 2026-08-28T04:06:54.496234+00:00)

## What it is
Sockette is a tiny (367 bytes) JavaScript wrapper around the WebSocket API that adds automatic reconnection with configurable timeout and max attempts. It lets you declare event listeners once and reuse the same instance across reconnects.

## Use cases
- keep a websocket connection alive with automatic reconnect
- reuse websocket event listeners across reconnections
- limit websocket reconnect attempts with backoff timeout
- send json messages over websocket easily
- gracefully close and later reconnect a websocket

## When to choose
- you want a minimal, zero-dependency websocket client with auto-reconnect
- you're tired of re-declaring WebSocket event handlers after each reconnect
- bundle size matters and you only need reconnect logic on top of native WebSocket

## When to avoid
- you need a full-featured realtime client with channels, presence, or fallback transports (use socket.io or similar)
- you need reconnection in environments without native WebSocket support
- you need queueing of messages sent while disconnected

## Facets
- artifact type: library
- maturity: maintenance
- function: websocket, http-client
- domain: web-development, developer-tools
- platform: browser, cross-platform
- tags: websocket-wrapper, auto-reconnect, tiny-library, zero-dependency, real-time, nodejs

## Member repositories
- lukeed/sockette (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:54.496234+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-30T02:29:11.396118+00:00, confidence not recorded.
  - readme: https://github.com/lukeed/sockette (fetched 2026-08-28T04:06:54.496234+00:00, sha baf22a74563f)
  - registry_npm: https://registry.npmjs.org/sockette (fetched 2026-08-29T10:10:35.425631+00:00, sha abb1073cab03)
- Data as of 2026-08-30T08:39:29.467469+00:00.
