---
title: "Spinetab"
url: "https://spinetab.com/"
description: "Share live subscriptions across browser tabs with Spinetab, a client-side TypeScript library for WebSocket, SSE, fetch streams and polling."
---

# One connection, every tab.

Share live subscriptions to your server across tabs with [SharedWorker](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker). Reconnect automatically after interruptions.

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

[Get started](https://spinetab.com/docs/getting-started.md) [Try live examples](https://spinetab.com/docs/examples/orbit.md)

## 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

-   **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

-   **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](https://spinetab.com/docs/getting-started.md) `pnpm add spinetab`

### Core

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

[`spinetab`](https://spinetab.com/docs/getting-started.md) [`spinetab/worker`](https://spinetab.com/docs/your-worker.md)

### Transports

Connect to your HTTP or WebSocket endpoints.

-   [WebSocket `/websocket`](https://spinetab.com/docs/transports/websocket.md)
-   [Server-sent events `/sse`](https://spinetab.com/docs/transports/sse.md)
-   [Fetch streams `/stream`](https://spinetab.com/docs/transports/stream.md)
-   [HTTP polling `/polling`](https://spinetab.com/docs/transports/polling.md)

### Protocol adapters

Share existing protocol clients in the worker.

-   [GraphQL over WebSocket `/graphql-ws`](https://spinetab.com/docs/protocols/graphql.md#graphql-over-websocket)
-   [GraphQL over SSE `/graphql-sse`](https://spinetab.com/docs/protocols/graphql.md#graphql-over-sse)
-   [Socket.IO `/socket-io`](https://spinetab.com/docs/protocols/socket-io.md)

### Library integrations

Use shared subscriptions with your data libraries.

-   [Apollo Client `/apollo`](https://spinetab.com/docs/integrations/apollo.md)
-   [TanStack Query `/tanstack-query`](https://spinetab.com/docs/integrations/tanstack-query.md)
-   [SWR `/swr`](https://spinetab.com/docs/integrations/swr.md)
-   [tRPC `/trpc`](https://spinetab.com/docs/integrations/trpc.md)
-   [AI SDK `/ai-sdk`](https://spinetab.com/docs/integrations/ai-sdk.md)

### Framework bindings

Subscription cleanup and reactive connection status.

-   [React `/react`](https://spinetab.com/docs/frameworks.md#react)
-   [Vue `/vue`](https://spinetab.com/docs/frameworks.md#vue)
-   [Svelte `/svelte`](https://spinetab.com/docs/frameworks.md#svelte)
-   [Solid `/solid`](https://spinetab.com/docs/frameworks.md#solid)
