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
- Return data on success
- Throw on HTTP failure (
FetchError) - Honor
AbortSignalso cancel / unmount is clean
Core entry points
| Import | What you get | gzip |
|---|---|---|
tanstack-fetch | HTTP (get / post / … / request) | 3.57KB |
tanstack-fetch/sse | + upload(), shortcuts, api.sse() | 6.33KB |
tanstack-fetch/live | + sse / ws / transport / stream | 8.75KB |
tanstack-fetch/plugins | plugin factories | 1.13KB |
tanstack-fetch/trpc | tRPC link via createFetch | 3.28KB |
tanstack-fetch/devtools | request dock | 8.70KB |
import { createFetch } from 'tanstack-fetch' // HTTP only
import { createFetch } from 'tanstack-fetch/sse' // + SSE
import { createFetch } from 'tanstack-fetch/live' // + SSE, WebSocket, WebTransport, NDJSONCore 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
| Import | What you get | gzip |
|---|---|---|
tanstack-fetch/react | FetchProvider / useFetch / useSse / useWs | 0.99KB |
Vue / Nuxt
Framework
Vue 3 / Nuxt · tanstack-fetch/vue
| Import | What you get | gzip |
|---|---|---|
tanstack-fetch/vue | plugin / composables (Vue 3 / Nuxt) | 0.94KB |
Solid
Framework
Solid · tanstack-fetch/solid
| Import | What you get |
|---|---|
tanstack-fetch/solid | FetchProvider / useFetch / useSse / useWs |
Angular
Framework
Angular · tanstack-fetch/angular
| Import | What you get |
|---|---|
tanstack-fetch/angular | provideFetchClient / injectFetch / useSse / useWs |
Svelte / SvelteKit
Framework
Svelte · tanstack-fetch/svelte
| Import | What you get |
|---|---|
tanstack-fetch/svelte | setFetchClient / useFetch / useSse / useWs |
