Skip to content

What is tanstack-fetch? ​

tanstack-fetch (by Mohammad Garmabi) is a tiny, typed Fetch client shaped for @tanstack/query.

It is not an official TanStack package — it matches the same mental model Query expects from a queryFn.

Use the Framework picker to show only your stack.

Mental model ​

  1. Return data on success
  2. Throw on HTTP failure (FetchError)
  3. Honor AbortSignal so cancel / unmount is clean

Core entry points ​

ImportWhat you getgzip
tanstack-fetchHTTP (get / post / … / request)3.57KB
tanstack-fetch/sse+ upload(), shortcuts, api.sse()6.33KB
tanstack-fetch/live+ sse / ws / transport / stream8.75KB
tanstack-fetch/pluginsplugin factories1.13KB
tanstack-fetch/trpctRPC link via createFetch3.28KB
tanstack-fetch/devtoolsrequest dock8.70KB
ts
import { createFetch } from 'tanstack-fetch' // HTTP only
import { createFetch } from 'tanstack-fetch/sse' // + SSE
import { createFetch } from 'tanstack-fetch/live' // + SSE, WebSocket, WebTransport, NDJSON

Core vs full

tanstack-fetch is the slim core: baseUrl, headers, source, incoming, timeoutMs, interceptors, fetch, credentials, maxRetries — no upload() or progress events. Auth, status handlers and plugins go in interceptors via tanstack-fetch/plugins. getToken, auth, plugins: [...], onStatus, onUnauthorized / … shortcuts and upload() live on the full entries (/sse, /live, /trpc) and framework providers.

Next (core) ​

React ​

Framework

React · tanstack-fetch/react

ImportWhat you getgzip
tanstack-fetch/reactFetchProvider / useFetch / useSse / useWs0.99KB

Next.js ​

Framework

Next.js · React + ssr-forward

TanStack Start ​

Framework

TanStack Start · Query + Router context

Remix ​

Framework

Remix

Vue / Nuxt ​

Framework

Vue 3 / Nuxt · tanstack-fetch/vue

ImportWhat you getgzip
tanstack-fetch/vueplugin / composables (Vue 3 / Nuxt)0.94KB

Solid ​

Framework

Solid · tanstack-fetch/solid

ImportWhat you get
tanstack-fetch/solidFetchProvider / useFetch / useSse / useWs

SolidStart ​

Framework

SolidStart

Angular ​

Framework

Angular · tanstack-fetch/angular

ImportWhat you get
tanstack-fetch/angularprovideFetchClient / injectFetch / useSse / useWs

Svelte / SvelteKit ​

Framework

Svelte · tanstack-fetch/svelte

ImportWhat you get
tanstack-fetch/sveltesetFetchClient / useFetch / useSse / useWs

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