---
title: "Choose your integration"
url: "https://spinetab.com/docs/choose-integration/"
description: "Match your backend, frontend framework and data library without changing how your app renders or owns its cache."
---

# Choose your integration

Choose a complete setup for your app. Each recipe includes its dependencies, provider where needed, component and mounting instructions.

**Available recipes**

- [Vite · React · Component state · HTTP polling](https://spinetab.com/docs/recipes/vite-react/direct/polling.md)
- [Vite · React · Component state · Server-sent events](https://spinetab.com/docs/recipes/vite-react/direct/sse.md)
- [Vite · React · Component state · WebSocket](https://spinetab.com/docs/recipes/vite-react/direct/websocket.md)
- [Vite · React · Component state · Fetch stream](https://spinetab.com/docs/recipes/vite-react/direct/stream.md)
- [Vite · React · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-react/direct/graphql-ws.md)
- [Vite · React · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-react/direct/graphql-sse.md)
- [Vite · React · Component state · Socket.IO](https://spinetab.com/docs/recipes/vite-react/direct/socket-io.md)
- [Vite · React · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/vite-react/query/polling.md)
- [Vite · React · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/vite-react/query/sse.md)
- [Vite · React · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/vite-react/query/websocket.md)
- [Vite · React · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/vite-react/query/stream.md)
- [Vite · React · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-react/query/graphql-ws.md)
- [Vite · React · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-react/query/graphql-sse.md)
- [Vite · React · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/vite-react/query/socket-io.md)
- [Vite · React · SWR · HTTP polling](https://spinetab.com/docs/recipes/vite-react/swr/polling.md)
- [Vite · React · SWR · Server-sent events](https://spinetab.com/docs/recipes/vite-react/swr/sse.md)
- [Vite · React · SWR · WebSocket](https://spinetab.com/docs/recipes/vite-react/swr/websocket.md)
- [Vite · React · SWR · Fetch stream](https://spinetab.com/docs/recipes/vite-react/swr/stream.md)
- [Vite · React · SWR · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-react/swr/graphql-ws.md)
- [Vite · React · SWR · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-react/swr/graphql-sse.md)
- [Vite · React · SWR · Socket.IO](https://spinetab.com/docs/recipes/vite-react/swr/socket-io.md)
- [Vite · React · Apollo Client · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-react/apollo/graphql-ws.md)
- [Vite · React · Apollo Client · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-react/apollo/graphql-sse.md)
- [Vite · React · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/vite-react/trpc/trpc-ws.md)
- [Vite · React · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/vite-react/trpc/trpc-sse.md)
- [Vite · React · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/vite-react/ai/chat.md)
- [Vite · Vue · Component state · HTTP polling](https://spinetab.com/docs/recipes/vite-vue/direct/polling.md)
- [Vite · Vue · Component state · Server-sent events](https://spinetab.com/docs/recipes/vite-vue/direct/sse.md)
- [Vite · Vue · Component state · WebSocket](https://spinetab.com/docs/recipes/vite-vue/direct/websocket.md)
- [Vite · Vue · Component state · Fetch stream](https://spinetab.com/docs/recipes/vite-vue/direct/stream.md)
- [Vite · Vue · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-vue/direct/graphql-ws.md)
- [Vite · Vue · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-vue/direct/graphql-sse.md)
- [Vite · Vue · Component state · Socket.IO](https://spinetab.com/docs/recipes/vite-vue/direct/socket-io.md)
- [Vite · Vue · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/vite-vue/query/polling.md)
- [Vite · Vue · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/vite-vue/query/sse.md)
- [Vite · Vue · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/vite-vue/query/websocket.md)
- [Vite · Vue · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/vite-vue/query/stream.md)
- [Vite · Vue · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-vue/query/graphql-ws.md)
- [Vite · Vue · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-vue/query/graphql-sse.md)
- [Vite · Vue · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/vite-vue/query/socket-io.md)
- [Vite · Vue · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/vite-vue/trpc/trpc-ws.md)
- [Vite · Vue · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/vite-vue/trpc/trpc-sse.md)
- [Vite · Vue · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/vite-vue/ai/chat.md)
- [Vite · Svelte · Component state · HTTP polling](https://spinetab.com/docs/recipes/vite-svelte/direct/polling.md)
- [Vite · Svelte · Component state · Server-sent events](https://spinetab.com/docs/recipes/vite-svelte/direct/sse.md)
- [Vite · Svelte · Component state · WebSocket](https://spinetab.com/docs/recipes/vite-svelte/direct/websocket.md)
- [Vite · Svelte · Component state · Fetch stream](https://spinetab.com/docs/recipes/vite-svelte/direct/stream.md)
- [Vite · Svelte · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-svelte/direct/graphql-ws.md)
- [Vite · Svelte · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-svelte/direct/graphql-sse.md)
- [Vite · Svelte · Component state · Socket.IO](https://spinetab.com/docs/recipes/vite-svelte/direct/socket-io.md)
- [Vite · Svelte · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/vite-svelte/query/polling.md)
- [Vite · Svelte · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/vite-svelte/query/sse.md)
- [Vite · Svelte · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/vite-svelte/query/websocket.md)
- [Vite · Svelte · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/vite-svelte/query/stream.md)
- [Vite · Svelte · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-svelte/query/graphql-ws.md)
- [Vite · Svelte · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-svelte/query/graphql-sse.md)
- [Vite · Svelte · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/vite-svelte/query/socket-io.md)
- [Vite · Svelte · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/vite-svelte/trpc/trpc-ws.md)
- [Vite · Svelte · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/vite-svelte/trpc/trpc-sse.md)
- [Vite · Svelte · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/vite-svelte/ai/chat.md)
- [Vite · Solid · Component state · HTTP polling](https://spinetab.com/docs/recipes/vite-solid/direct/polling.md)
- [Vite · Solid · Component state · Server-sent events](https://spinetab.com/docs/recipes/vite-solid/direct/sse.md)
- [Vite · Solid · Component state · WebSocket](https://spinetab.com/docs/recipes/vite-solid/direct/websocket.md)
- [Vite · Solid · Component state · Fetch stream](https://spinetab.com/docs/recipes/vite-solid/direct/stream.md)
- [Vite · Solid · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-solid/direct/graphql-ws.md)
- [Vite · Solid · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-solid/direct/graphql-sse.md)
- [Vite · Solid · Component state · Socket.IO](https://spinetab.com/docs/recipes/vite-solid/direct/socket-io.md)
- [Vite · Solid · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/vite-solid/query/polling.md)
- [Vite · Solid · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/vite-solid/query/sse.md)
- [Vite · Solid · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/vite-solid/query/websocket.md)
- [Vite · Solid · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/vite-solid/query/stream.md)
- [Vite · Solid · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/vite-solid/query/graphql-ws.md)
- [Vite · Solid · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/vite-solid/query/graphql-sse.md)
- [Vite · Solid · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/vite-solid/query/socket-io.md)
- [Vite · Solid · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/vite-solid/trpc/trpc-ws.md)
- [Vite · Solid · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/vite-solid/trpc/trpc-sse.md)
- [Next.js · Component state · HTTP polling](https://spinetab.com/docs/recipes/nextjs/direct/polling.md)
- [Next.js · Component state · Server-sent events](https://spinetab.com/docs/recipes/nextjs/direct/sse.md)
- [Next.js · Component state · WebSocket](https://spinetab.com/docs/recipes/nextjs/direct/websocket.md)
- [Next.js · Component state · Fetch stream](https://spinetab.com/docs/recipes/nextjs/direct/stream.md)
- [Next.js · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/nextjs/direct/graphql-ws.md)
- [Next.js · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/nextjs/direct/graphql-sse.md)
- [Next.js · Component state · Socket.IO](https://spinetab.com/docs/recipes/nextjs/direct/socket-io.md)
- [Next.js · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/nextjs/query/polling.md)
- [Next.js · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/nextjs/query/sse.md)
- [Next.js · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/nextjs/query/websocket.md)
- [Next.js · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/nextjs/query/stream.md)
- [Next.js · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/nextjs/query/graphql-ws.md)
- [Next.js · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/nextjs/query/graphql-sse.md)
- [Next.js · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/nextjs/query/socket-io.md)
- [Next.js · SWR · HTTP polling](https://spinetab.com/docs/recipes/nextjs/swr/polling.md)
- [Next.js · SWR · Server-sent events](https://spinetab.com/docs/recipes/nextjs/swr/sse.md)
- [Next.js · SWR · WebSocket](https://spinetab.com/docs/recipes/nextjs/swr/websocket.md)
- [Next.js · SWR · Fetch stream](https://spinetab.com/docs/recipes/nextjs/swr/stream.md)
- [Next.js · SWR · GraphQL over WebSocket](https://spinetab.com/docs/recipes/nextjs/swr/graphql-ws.md)
- [Next.js · SWR · GraphQL over SSE](https://spinetab.com/docs/recipes/nextjs/swr/graphql-sse.md)
- [Next.js · SWR · Socket.IO](https://spinetab.com/docs/recipes/nextjs/swr/socket-io.md)
- [Next.js · Apollo Client · GraphQL over WebSocket](https://spinetab.com/docs/recipes/nextjs/apollo/graphql-ws.md)
- [Next.js · Apollo Client · GraphQL over SSE](https://spinetab.com/docs/recipes/nextjs/apollo/graphql-sse.md)
- [Next.js · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/nextjs/trpc/trpc-ws.md)
- [Next.js · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/nextjs/trpc/trpc-sse.md)
- [Next.js · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/nextjs/ai/chat.md)
- [Astro · React · Component state · HTTP polling](https://spinetab.com/docs/recipes/astro-react/direct/polling.md)
- [Astro · React · Component state · Server-sent events](https://spinetab.com/docs/recipes/astro-react/direct/sse.md)
- [Astro · React · Component state · WebSocket](https://spinetab.com/docs/recipes/astro-react/direct/websocket.md)
- [Astro · React · Component state · Fetch stream](https://spinetab.com/docs/recipes/astro-react/direct/stream.md)
- [Astro · React · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-react/direct/graphql-ws.md)
- [Astro · React · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-react/direct/graphql-sse.md)
- [Astro · React · Component state · Socket.IO](https://spinetab.com/docs/recipes/astro-react/direct/socket-io.md)
- [Astro · React · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/astro-react/query/polling.md)
- [Astro · React · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/astro-react/query/sse.md)
- [Astro · React · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/astro-react/query/websocket.md)
- [Astro · React · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/astro-react/query/stream.md)
- [Astro · React · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-react/query/graphql-ws.md)
- [Astro · React · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-react/query/graphql-sse.md)
- [Astro · React · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/astro-react/query/socket-io.md)
- [Astro · React · SWR · HTTP polling](https://spinetab.com/docs/recipes/astro-react/swr/polling.md)
- [Astro · React · SWR · Server-sent events](https://spinetab.com/docs/recipes/astro-react/swr/sse.md)
- [Astro · React · SWR · WebSocket](https://spinetab.com/docs/recipes/astro-react/swr/websocket.md)
- [Astro · React · SWR · Fetch stream](https://spinetab.com/docs/recipes/astro-react/swr/stream.md)
- [Astro · React · SWR · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-react/swr/graphql-ws.md)
- [Astro · React · SWR · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-react/swr/graphql-sse.md)
- [Astro · React · SWR · Socket.IO](https://spinetab.com/docs/recipes/astro-react/swr/socket-io.md)
- [Astro · React · Apollo Client · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-react/apollo/graphql-ws.md)
- [Astro · React · Apollo Client · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-react/apollo/graphql-sse.md)
- [Astro · React · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/astro-react/trpc/trpc-ws.md)
- [Astro · React · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/astro-react/trpc/trpc-sse.md)
- [Astro · React · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/astro-react/ai/chat.md)
- [Astro · Vue · Component state · HTTP polling](https://spinetab.com/docs/recipes/astro-vue/direct/polling.md)
- [Astro · Vue · Component state · Server-sent events](https://spinetab.com/docs/recipes/astro-vue/direct/sse.md)
- [Astro · Vue · Component state · WebSocket](https://spinetab.com/docs/recipes/astro-vue/direct/websocket.md)
- [Astro · Vue · Component state · Fetch stream](https://spinetab.com/docs/recipes/astro-vue/direct/stream.md)
- [Astro · Vue · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-vue/direct/graphql-ws.md)
- [Astro · Vue · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-vue/direct/graphql-sse.md)
- [Astro · Vue · Component state · Socket.IO](https://spinetab.com/docs/recipes/astro-vue/direct/socket-io.md)
- [Astro · Vue · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/astro-vue/query/polling.md)
- [Astro · Vue · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/astro-vue/query/sse.md)
- [Astro · Vue · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/astro-vue/query/websocket.md)
- [Astro · Vue · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/astro-vue/query/stream.md)
- [Astro · Vue · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-vue/query/graphql-ws.md)
- [Astro · Vue · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-vue/query/graphql-sse.md)
- [Astro · Vue · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/astro-vue/query/socket-io.md)
- [Astro · Vue · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/astro-vue/trpc/trpc-ws.md)
- [Astro · Vue · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/astro-vue/trpc/trpc-sse.md)
- [Astro · Vue · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/astro-vue/ai/chat.md)
- [Astro · Svelte · Component state · HTTP polling](https://spinetab.com/docs/recipes/astro-svelte/direct/polling.md)
- [Astro · Svelte · Component state · Server-sent events](https://spinetab.com/docs/recipes/astro-svelte/direct/sse.md)
- [Astro · Svelte · Component state · WebSocket](https://spinetab.com/docs/recipes/astro-svelte/direct/websocket.md)
- [Astro · Svelte · Component state · Fetch stream](https://spinetab.com/docs/recipes/astro-svelte/direct/stream.md)
- [Astro · Svelte · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-svelte/direct/graphql-ws.md)
- [Astro · Svelte · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-svelte/direct/graphql-sse.md)
- [Astro · Svelte · Component state · Socket.IO](https://spinetab.com/docs/recipes/astro-svelte/direct/socket-io.md)
- [Astro · Svelte · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/astro-svelte/query/polling.md)
- [Astro · Svelte · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/astro-svelte/query/sse.md)
- [Astro · Svelte · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/astro-svelte/query/websocket.md)
- [Astro · Svelte · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/astro-svelte/query/stream.md)
- [Astro · Svelte · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-svelte/query/graphql-ws.md)
- [Astro · Svelte · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-svelte/query/graphql-sse.md)
- [Astro · Svelte · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/astro-svelte/query/socket-io.md)
- [Astro · Svelte · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/astro-svelte/trpc/trpc-ws.md)
- [Astro · Svelte · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/astro-svelte/trpc/trpc-sse.md)
- [Astro · Svelte · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/astro-svelte/ai/chat.md)
- [Astro · Solid · Component state · HTTP polling](https://spinetab.com/docs/recipes/astro-solid/direct/polling.md)
- [Astro · Solid · Component state · Server-sent events](https://spinetab.com/docs/recipes/astro-solid/direct/sse.md)
- [Astro · Solid · Component state · WebSocket](https://spinetab.com/docs/recipes/astro-solid/direct/websocket.md)
- [Astro · Solid · Component state · Fetch stream](https://spinetab.com/docs/recipes/astro-solid/direct/stream.md)
- [Astro · Solid · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-solid/direct/graphql-ws.md)
- [Astro · Solid · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-solid/direct/graphql-sse.md)
- [Astro · Solid · Component state · Socket.IO](https://spinetab.com/docs/recipes/astro-solid/direct/socket-io.md)
- [Astro · Solid · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/astro-solid/query/polling.md)
- [Astro · Solid · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/astro-solid/query/sse.md)
- [Astro · Solid · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/astro-solid/query/websocket.md)
- [Astro · Solid · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/astro-solid/query/stream.md)
- [Astro · Solid · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/astro-solid/query/graphql-ws.md)
- [Astro · Solid · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/astro-solid/query/graphql-sse.md)
- [Astro · Solid · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/astro-solid/query/socket-io.md)
- [Astro · Solid · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/astro-solid/trpc/trpc-ws.md)
- [Astro · Solid · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/astro-solid/trpc/trpc-sse.md)
- [Nuxt · Component state · HTTP polling](https://spinetab.com/docs/recipes/nuxt/direct/polling.md)
- [Nuxt · Component state · Server-sent events](https://spinetab.com/docs/recipes/nuxt/direct/sse.md)
- [Nuxt · Component state · WebSocket](https://spinetab.com/docs/recipes/nuxt/direct/websocket.md)
- [Nuxt · Component state · Fetch stream](https://spinetab.com/docs/recipes/nuxt/direct/stream.md)
- [Nuxt · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/nuxt/direct/graphql-ws.md)
- [Nuxt · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/nuxt/direct/graphql-sse.md)
- [Nuxt · Component state · Socket.IO](https://spinetab.com/docs/recipes/nuxt/direct/socket-io.md)
- [Nuxt · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/nuxt/query/polling.md)
- [Nuxt · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/nuxt/query/sse.md)
- [Nuxt · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/nuxt/query/websocket.md)
- [Nuxt · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/nuxt/query/stream.md)
- [Nuxt · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/nuxt/query/graphql-ws.md)
- [Nuxt · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/nuxt/query/graphql-sse.md)
- [Nuxt · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/nuxt/query/socket-io.md)
- [Nuxt · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/nuxt/trpc/trpc-ws.md)
- [Nuxt · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/nuxt/trpc/trpc-sse.md)
- [Nuxt · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/nuxt/ai/chat.md)
- [SvelteKit · Component state · HTTP polling](https://spinetab.com/docs/recipes/sveltekit/direct/polling.md)
- [SvelteKit · Component state · Server-sent events](https://spinetab.com/docs/recipes/sveltekit/direct/sse.md)
- [SvelteKit · Component state · WebSocket](https://spinetab.com/docs/recipes/sveltekit/direct/websocket.md)
- [SvelteKit · Component state · Fetch stream](https://spinetab.com/docs/recipes/sveltekit/direct/stream.md)
- [SvelteKit · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/sveltekit/direct/graphql-ws.md)
- [SvelteKit · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/sveltekit/direct/graphql-sse.md)
- [SvelteKit · Component state · Socket.IO](https://spinetab.com/docs/recipes/sveltekit/direct/socket-io.md)
- [SvelteKit · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/sveltekit/query/polling.md)
- [SvelteKit · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/sveltekit/query/sse.md)
- [SvelteKit · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/sveltekit/query/websocket.md)
- [SvelteKit · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/sveltekit/query/stream.md)
- [SvelteKit · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/sveltekit/query/graphql-ws.md)
- [SvelteKit · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/sveltekit/query/graphql-sse.md)
- [SvelteKit · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/sveltekit/query/socket-io.md)
- [SvelteKit · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/sveltekit/trpc/trpc-ws.md)
- [SvelteKit · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/sveltekit/trpc/trpc-sse.md)
- [SvelteKit · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/sveltekit/ai/chat.md)
- [React Router · Component state · HTTP polling](https://spinetab.com/docs/recipes/react-router/direct/polling.md)
- [React Router · Component state · Server-sent events](https://spinetab.com/docs/recipes/react-router/direct/sse.md)
- [React Router · Component state · WebSocket](https://spinetab.com/docs/recipes/react-router/direct/websocket.md)
- [React Router · Component state · Fetch stream](https://spinetab.com/docs/recipes/react-router/direct/stream.md)
- [React Router · Component state · GraphQL over WebSocket](https://spinetab.com/docs/recipes/react-router/direct/graphql-ws.md)
- [React Router · Component state · GraphQL over SSE](https://spinetab.com/docs/recipes/react-router/direct/graphql-sse.md)
- [React Router · Component state · Socket.IO](https://spinetab.com/docs/recipes/react-router/direct/socket-io.md)
- [React Router · TanStack Query · HTTP polling](https://spinetab.com/docs/recipes/react-router/query/polling.md)
- [React Router · TanStack Query · Server-sent events](https://spinetab.com/docs/recipes/react-router/query/sse.md)
- [React Router · TanStack Query · WebSocket](https://spinetab.com/docs/recipes/react-router/query/websocket.md)
- [React Router · TanStack Query · Fetch stream](https://spinetab.com/docs/recipes/react-router/query/stream.md)
- [React Router · TanStack Query · GraphQL over WebSocket](https://spinetab.com/docs/recipes/react-router/query/graphql-ws.md)
- [React Router · TanStack Query · GraphQL over SSE](https://spinetab.com/docs/recipes/react-router/query/graphql-sse.md)
- [React Router · TanStack Query · Socket.IO](https://spinetab.com/docs/recipes/react-router/query/socket-io.md)
- [React Router · SWR · HTTP polling](https://spinetab.com/docs/recipes/react-router/swr/polling.md)
- [React Router · SWR · Server-sent events](https://spinetab.com/docs/recipes/react-router/swr/sse.md)
- [React Router · SWR · WebSocket](https://spinetab.com/docs/recipes/react-router/swr/websocket.md)
- [React Router · SWR · Fetch stream](https://spinetab.com/docs/recipes/react-router/swr/stream.md)
- [React Router · SWR · GraphQL over WebSocket](https://spinetab.com/docs/recipes/react-router/swr/graphql-ws.md)
- [React Router · SWR · GraphQL over SSE](https://spinetab.com/docs/recipes/react-router/swr/graphql-sse.md)
- [React Router · SWR · Socket.IO](https://spinetab.com/docs/recipes/react-router/swr/socket-io.md)
- [React Router · Apollo Client · GraphQL over WebSocket](https://spinetab.com/docs/recipes/react-router/apollo/graphql-ws.md)
- [React Router · Apollo Client · GraphQL over SSE](https://spinetab.com/docs/recipes/react-router/apollo/graphql-sse.md)
- [React Router · tRPC · tRPC over WebSocket](https://spinetab.com/docs/recipes/react-router/trpc/trpc-ws.md)
- [React Router · tRPC · tRPC over SSE](https://spinetab.com/docs/recipes/react-router/trpc/trpc-sse.md)
- [React Router · AI SDK · Resumable chat](https://spinetab.com/docs/recipes/react-router/ai/chat.md)

Use one subscription path for each view: component state or your existing data library.

## Match your backend

All seven sources below work with the [React, Vue, Svelte and Solid bindings](https://spinetab.com/docs/frameworks.md) and the vanilla `spinetab.subscribe()` API. TanStack Query and SWR also accept these sources; their `map` option adapts events to your data shape. TanStack Query also provides `reduce` for accumulating updates.

| Backend | Source | Library integration |
| --- | --- | --- |
| HTTP JSON | [`polling()`](https://spinetab.com/docs/transports/polling.md) | TanStack Query or SWR |
| Server-sent events | [`sse()`](https://spinetab.com/docs/transports/sse.md) | TanStack Query or SWR |
| Raw WebSocket | [`websocket()`](https://spinetab.com/docs/transports/websocket.md) | TanStack Query or SWR |
| Fetch stream | [`stream()`](https://spinetab.com/docs/transports/stream.md) | TanStack Query or SWR |
| GraphQL over WebSocket | [`graphqlWs().subscription()`](https://spinetab.com/docs/protocols/graphql.md#graphql-over-websocket) | Apollo, TanStack Query or SWR |
| GraphQL over SSE | [`graphqlSse().subscription()`](https://spinetab.com/docs/protocols/graphql.md#graphql-over-sse) | Apollo, TanStack Query or SWR |
| Socket.IO | [`socketIo().subscription()`](https://spinetab.com/docs/protocols/socket-io.md) | TanStack Query or SWR |

[Apollo](https://spinetab.com/docs/integrations/apollo.md) accepts the GraphQL **endpoint** directly and builds operations from your documents. With TanStack Query, SWR or a UI binding, build the `.subscription()` request yourself. GraphQL results include `data` and `errors`; Socket.IO events are argument arrays. Neither is silently converted into an application value.

Two integrations provide their own transport path:

-   [tRPC](https://spinetab.com/docs/integrations/trpc.md) uses `spinetabWsLink` or `spinetabSseLink` with a tRPC server. Keep calling the typed tRPC client; do not wrap it in `websocket()` or `sse()`.
-   [AI SDK](https://spinetab.com/docs/integrations/ai-sdk.md) uses `SpinetabChatTransport` with the AI SDK UI message stream protocol. It handles chat start/resume requests, not arbitrary polling or WebSocket feeds.

## Choose where the data lives

| Your data layer | Frontend fit | Start here |
| --- | --- | --- |
| Component state | React, Vue, Svelte, Solid; vanilla callbacks | [Using subscriptions](https://spinetab.com/docs/frameworks.md) |
| TanStack Query | Any of its React, Vue, Svelte or Solid clients backed by the compatible Query core | [Bind a cache and clean up by framework](https://spinetab.com/docs/integrations/tanstack-query.md#start-and-stop-with-your-component) |
| SWR | React, including Next.js and React Router | [SWR subscription hook](https://spinetab.com/docs/integrations/swr.md) |
| Apollo | Apollo Client 4’s link API; use a UI library compatible with that version | [GraphQL link and React example](https://spinetab.com/docs/integrations/apollo.md) |
| tRPC | Framework-independent typed client; keep your existing UI integration | [Subscription links and cleanup](https://spinetab.com/docs/integrations/trpc.md#use-it-in-your-app) |
| AI SDK | A chat UI accepting the installed AI SDK’s `ChatTransport` interface | [Chat transport and follow lifecycle](https://spinetab.com/docs/integrations/ai-sdk.md) |

SWR’s hook cannot be used in Vue, Svelte or Solid. Apollo and AI SDK transport compatibility does not imply that every third-party UI wrapper supports the required peer version; check that wrapper before adopting it. For GraphQL without an Apollo wrapper, use the [direct source](https://spinetab.com/docs/protocols/graphql.md) with a Spinetab UI binding.

## Keep your framework’s client boundary

The backend choice does not change the build plugin or component lifecycle. The library choice may add its own provider or cache; Spinetab does not replace it.

| Setup | Where the subscription belongs |
| --- | --- |
| [Vite](https://spinetab.com/docs/setup/vite.md) | In the component lifecycle for React, Vue, Svelte or Solid |
| [Next.js](https://spinetab.com/docs/setup/nextjs.md) | Below a `"use client"` boundary; keep library providers in that client tree |
| [Nuxt](https://spinetab.com/docs/setup/nuxt.md) | In a Vue component; mount imperative bindings in the browser, not a server plugin |
| [SvelteKit](https://spinetab.com/docs/setup/sveltekit.md) | In a component store or `onMount`; not a server `load` function |
| [React Router](https://spinetab.com/docs/setup/react-router.md) | In the route component; not a server `loader` or `action` |
| [Astro](https://spinetab.com/docs/setup/astro.md) | Inside a hydrated island; keep library providers and consumers in the same island |
| [Other bundlers / vanilla](https://spinetab.com/docs/bundlers.md) | Start when the browser view mounts and dispose when it is removed |

With server rendering, keep request-specific data and library caches scoped to that request. A shared browser connection does not share a cache between tabs or make a server module singleton safe for user data.

## Adapt protocol results

These are the two extra data shapes to handle when replacing the plain JSON sources in a framework guide. Declare `anonymous: true` or a `credentials` callback on your client, and install the protocol’s peer libraries.

### GraphQL

**File: `queue-source.ts`**

```ts
import { graphqlWs } from "spinetab/graphql-ws";
import { QueueChangedDocument } from "./generated/graphql";

export const queueSource = graphqlWs("/graphql").subscription({
  query: QueueChangedDocument,
});
```

`QueueChangedDocument` is your generated typed document for `subscription { queue { open } }`. A plain query string also works, but its result fields are untyped. Install `graphql` and `graphql-ws`. For GraphQL over SSE, install `graphql-sse` and use `graphqlSse("/graphql/stream")` instead. The request and result shape stay the same.

The binding’s `data` is a GraphQL result: read `data?.data?.queue.open` and handle `data?.errors` as well as the binding’s transport `error`. In TanStack Query or SWR, a `map` callback can select `result.data?.queue`; decide explicitly how your app handles partial results and GraphQL errors before caching them.

### Socket.IO

**File: `queue-source.ts`**

```ts
import { socketIo } from "spinetab/socket-io";

export const queueSource = socketIo("/", { sharing: "shared" }).subscription<
  [{ open: number }]
>({ event: "queue" });
```

Install `socket.io-client`. This expects the server to emit `socket.emit("queue", { open: 12 })`. Read `data?.[0].open`, or use `map: ([queue]) => queue` in the binding, TanStack Query or SWR. Only choose `sharing: "shared"` if merging tabs onto one socket suits your server; see [rooms and sharing](https://spinetab.com/docs/protocols/socket-io.md).

## Choose recovery from the data, not the transport

-   **Complete current value on every event:** `reconcile: "latest"` restores continuity when the next complete value arrives.
-   **Incremental changes:** refresh a snapshot and merge it with live events, or use server replay with a policy for delivery overflow.
-   **One-off work:** do not make a request repeatable just to enable sharing. Use the operation’s explicit start/resume contract.

See [recovery policies](https://spinetab.com/docs/concepts/continuity.md) for implementations. The same choice applies in every framework; a reconnected transport alone does not prove that your displayed data is complete.
