eden-tanstack-query

Type-safe TanStack Query integration for Elysia Eden. Like @trpc/react-query, but for Elysia.

TypeScriptTanStack QueryElysiaBun
eden-tanstack-query

Type-safe TanStack Query integration for Elysia Eden. Works like @trpc/react-query, but for the Elysia ecosystem.

Motivation

Elysia is a fast, type-safe HTTP framework for Bun. Its client library (Eden) provides end-to-end type safety, but lacked a first-class integration with TanStack Query — the de facto standard for server state management in React apps.

This library bridges that gap: you get the full TanStack Query API with automatic type inference from your Elysia server routes.

Features

  • Full TanStack Query API: useQuery, useMutation, useSuspenseQuery, useInfiniteQuery, and more
  • Automatic type inference from Elysia Eden treaty
  • React hooks and vanilla client
  • skipToken support, per-request typed headers, cursor-aware infinite queries
  • 92% test coverage, three runnable example apps (basic → large)
  • 13.5 KB, 3.2 KB gzipped

Published on npm as eden-tanstack-react-query. Full documentation at eden-query.xkel.me. Actively maintained — recent releases ship fixes and features contributed by the community.