TanStack Query SSE in React: Authenticated Live Updates
Build authenticated Server-Sent Events in React with TanStack Query. Update the cache, resume after disconnects with Last-Event-ID, and avoid polling.
Read the postThe tanstack-fetch blog
Tutorials, framework deep dives, and release notes about data fetching with TanStack Query and tanstack-fetch.
27 posts
·6 min read
Build authenticated Server-Sent Events in React with TanStack Query. Update the cache, resume after disconnects with Last-Event-ID, and avoid polling.
·7 min read
Stream NDJSON responses into TanStack Query with experimental_streamedQuery and tanstack-fetch. Learn cancellation, refetch behavior, and reliability trade-offs.
·5 min read
Prevent cross-request cookie and token leaks in SvelteKit SSR. Build request-scoped tanstack-fetch clients, forward cookies safely, and keep browser clients separate.
·5 min read
Build typed React WebSocket updates with TanStack Query: load snapshots, update the cache, reconnect safely, and authenticate browser sockets.
·8 min read
TanStack Query error handling with fetch: why fetch never throws on 404 or 500, typed errors with Register, global toasts, error boundaries, form errors and retry rules.
Releases·11 min read
tanstack-fetch 2.2.1 fixes 31 bugs: relative baseUrl, createTRPCFetch from npm, SSE reconnects with Last-Event-ID, SSR leaks in Svelte and Vue, a DevTools XSS.
Framework guides·7 min read
Fix TanStack Query retry that stops, never fires or doubles requests: causes in production, SSR, background tabs and cancellation, with the setting for...
Tutorials·4 min read
Build the frontend before the backend ships: mock a REST endpoint, an SSE price feed, an NDJSON chat and a WebSocket room, then switch each mock off.
Releases·3 min read
tanstack-fetch 2.1.0: abort during a retry delay, literal colons in paths, a safer refresh-token race, no stream-body retries, plus array query values.
Releases·2 min read
The tanstack-fetch core drops from 5.14KB to 3.57KB gzip: auth, status handlers and plugins become interceptors, and live APIs type path params like api.get.
Releases·5 min read
New tanstack-fetch/live entry: authenticated WebSocket with reconnect and a send queue, WebTransport over HTTP/3, NDJSON streaming over fetch, and useWs hooks.
Tutorials·8 min read
Learn to debounce TanStack Query searches, throttle infinite scroll, rate-limit API calls, queue uploads and batch requests with TanStack Pacer.
Releases·3 min read
Patch release: path params with ports and colons, timeouts reject with TimeoutError, no leaking timers, byte bodies sent as bytes, HTML 502s keep status.
Framework guides·4 min read
Replace Angular HttpClient glue with tanstack-fetch: provideFetchClient, injectFetch, SSE as signals, Angular Query, refresh tokens and the migrate CLI.
Framework guides·3 min read
Use tanstack-fetch in Next.js App Router — ssr-forward cookies, absolute baseUrl on the server, React Query dehydrate/hydrate, SSE, and migrate path.
Framework guides·3 min read
Replace Nuxt $fetch glue with tanstack-fetch — createFetchPlugin, ssr-forward, useFetchClient naming, Vue Query hydrate, SSE, and comparison graphs.
Framework guides·3 min read
Replace axios unwrap glue with tanstack-fetch — FetchProvider, useFetch, useSse, React Query, refresh-token, migrate CLI, and a full side-by-side comparison.
Framework guides·3 min read
Use tanstack-fetch with Solid — FetchProvider, useFetch, useSse signals, Solid Query, refresh-token, migrate CLI, and comparison graphs.
Framework guides·3 min read
Compare SvelteKit event.fetch with tanstack-fetch for TanStack Query, SSR cookie forwarding, typed errors and authenticated SSE. Includes practical Svelte examples.
Framework guides·3 min read
Wire tanstack-fetch into TanStack Start and TanStack Router — queryOptions, ensureQueryData loaders, router context, SSR, tRPC, and comparison graphs.
Tutorials·7 min read
Six TanStack Start 1.0 data fetching patterns: direct fetching, shared loaders, SSR auth, mutations, central error handling and live SSE updates.
Framework guides·3 min read
Replace ofetch and axios glue in Vue 3 with tanstack-fetch — createFetchPlugin, useFetch, useSse, Vue Query, refresh-token, and a full comparison.
Releases·1 min read
Health-check with tanstack-fetch doctor, real Solid/Angular/Svelte adapters, migrate scaffolds, and a docs Framework picker.
Releases·2 min read
CLI that scans axios, ky, ofetch, $fetch, and fetch call sites, applies safe rewrites for TanStack Query, and scaffolds React, Vue, Nuxt, or Next.js.
Releases·1 min read
createFetchPlugin, useFetch, and useSse for Vue 3 and Nuxt — same client as React.
Releases·1 min read
Pass a params map as the second type argument — api.get<User, { id: number }>(…) — and optional body typing on post/put/patch.
Releases·3 min read
Refresh tokens without hand-written interceptors, a DevTools panel for HTTP, SSE, SSR and tRPC, and a useSse hook that no longer needs a provider.