One connection,
every tab.

Share live subscriptions to your server across tabs with SharedWorker. Reconnect automatically after interruptions.

A client-side TypeScript library. Works with your existing backend.

How connection sharing works

If your app opens a WebSocket or SSE connection in each tab, three tabs create three server connections. Spinetab runs the client in a SharedWorker so compatible tabs can share it.

Without Spinetab

3 connections
Tab 1 Tab 2 Tab 3 Your server
  • A connection per tab.

    Each tab opens its own connection to the same server.

  • Repeated subscriptions.

    Each tab requests its own copy of the same live updates.

  • Separate reconnects.

    Each tab reconnects and restores its own subscriptions.

With Spinetab

1 connection
Tab 1 Tab 2 Tab 3 spinetab SharedWorker Your server
  • A shared connection.

    One worker shares a server connection across your tabs.

  • Shared subscriptions.

    Matching requests share one subscription to live updates.

  • Coordinated recovery.

    One worker reconnects and restores shared subscriptions.

Package and adapters

One package. Import the parts your app uses.

Get started pnpm add spinetab

Core

Connection sharing, subscription lifetimes and recovery. Your app keeps control of its data and cache.