What is tanstack-fetch?
tanstack-fetch (by Mohammad Garmabi) is a tiny, typed Fetch client shaped for @tanstack/react-query.
It is not an official TanStack package — it matches the same mental model Query expects from a queryFn:
- Return data on success
- Throw on HTTP failure (
FetchError) - Honor
AbortSignalso cancel / unmount is clean

Who it’s for
- Apps already on TanStack Query that want a smaller alternative to axios / ky
- Next.js / TanStack Start apps that need SSR cookie forwarding
- Teams that want SSE with
Authorization(notEventSource) - tRPC users who want one shared auth/plugin client
Entry points

| Import | What you get | Typical gzip |
|---|---|---|
tanstack-fetch | HTTP (get / post / upload / …) | ~3.5KB |
tanstack-fetch/sse | + api.sse() | ~4.7KB |
tanstack-fetch/plugins | plugin factories | ~0.9KB |
tanstack-fetch/react | FetchProvider / hooks | ~1KB |
tanstack-fetch/trpc | tRPC link via createFetch | ~3.1KB |
ts
import { createFetch } from 'tanstack-fetch' // HTTP only
import { createFetch } from 'tanstack-fetch/sse' // + streams