Skip to content

tanstack-fetchTyped Fetch for TanStack Query

By Mohammad Garmabi · Tiny HTTP core · typed errors · AbortSignal · SSR · SSE · tRPC — built for the queryFn mental model.

tanstack-fetch fox logo by Mohammad Garmabi

tanstack-fetch logo

tanstack-fetch by Mohammad Garmabi — createFetch + TanStack Query demo

tanstack-fetch on npmtanstack-fetch weekly downloadstanstack-fetch monthly downloadstanstack-fetch total downloads

Visual overview

Mental modelTanStack Query
Auth & statustRPC
SSRSSE
ts
import { createFetch } from 'tanstack-fetch'
import { useQuery } from '@tanstack/react-query'

const api = createFetch({ baseUrl: 'https://api.example.com' })

useQuery({
  queryKey: ['users'],
  queryFn: ({ signal }) => api.get<User[]>('/users', { signal }),
})

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