Skip to content

tanstack-fetch 1.5.0: Vue and Nuxt ​

October 1, 2026

tanstack-fetch 1.5.0: Vue and Nuxt

tanstack-fetch/vue mirrors the React helpers for Vue 3 and Nuxt.

What you get ​

ExportRole
createFetchPluginapp.use / Nuxt plugin
provideFetchClientprovide in a composition scope
useFetchInject the shared client
useSseSSE composable (returns refs + status)

Prefer passing the SSE client directly:

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

Nuxt ​

ts
// 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.

Docs ​

MIT Licensed · Created by Mohammad Garmabi · Not an official TanStack package