Releasestanstack-fetch 2.2.1: SSE reconnects and SSR fixes
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.
Read the postOctober 1, 2026
tanstack-fetch/vue mirrors the React helpers for Vue 3 and Nuxt.
| Export | Role |
|---|---|
createFetchPlugin | app.use / Nuxt plugin |
provideFetchClient | provide in a composition scope |
useFetch | Inject the shared client |
useSse | SSE composable (returns refs + status) |
Prefer passing the SSE client directly:
<script setup lang="ts">
import { createFetch } from 'tanstack-fetch/sse'
import { useSse } from 'tanstack-fetch/vue'
const api = createFetch({ plugins: ['sse-resume'] })
const { data, status, error, close } = useSse<OrderEvent>('/orders/stream', {
client: api,
})
</script>// plugins/tanstack-fetch.ts
import { createFetch } from 'tanstack-fetch/sse'
import { createFetchPlugin } from 'tanstack-fetch/vue'
export default defineNuxtPlugin((nuxtApp) => {
const api = createFetch({
baseUrl: useRuntimeConfig().public.apiBase,
plugins: ['sse-resume'],
})
nuxtApp.vueApp.use(createFetchPlugin({ client: api }))
})Nuxt’s own useFetch keeps its name — import ours as useFetchClient when needed.
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.
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.