Skip to main content

One SDK. Any API.
Fully TypedTyped.

The type-safe API layer for TypeScript apps. Connect to REST, GraphQL, Firebase, WebSockets, SSE . All with one consistent interface and the best type safety in the ecosystem.

Loading preview...
Companies that use BetterTyped open-source software.
Why this exists

Same bugs, different project

Apps break when cache, realtime events, retries, queues, and UI state each follow different rules in different libraries. HyperFetch puts them under one roof.

Common problem
HyperFetch answer

Five libraries for one data flow

Axios for fetching. React Query for caching. A custom hook for retries. Another package for WebSockets. Each with its own config and mental model.

One client replaces all of them

Fetch, cache, retry, queue, dedup, and offline replay. One import, one configuration surface, zero glue code between packages.

Every endpoint is hand-written

REST calls, socket listeners, Firebase queries. Each one gets its own wrapper, type definition, and error handler. Add a new endpoint, copy-paste the last one, tweak it.

SDK generated from your schema or types

Point at an OpenAPI spec or import types from your monorepo backend. HyperFetch generates a fully typed SDK for REST and Sockets. No hand-written wrappers.

Cache shows stale data after mutations

You update a record, but three other components still render the old version until someone refreshes the page. Rollbacks are manual. Nothing is type-checked.

Typed optimistic updates with automatic rollback

Mutate the UI instantly with fully typed cache updates. If the server rejects, HyperFetch rolls back automatically. WebSocket events can update REST cache in real time.

WebSockets break your patterns

REST uses hooks and query clients. Sockets get a custom event system. Two separate data layers with different error handling.

Same mental model for realtime

WebSockets, SSE, and Firebase listeners follow the same typed request pattern. Shared lifecycle, shared retries, shared queue logic.

AI gets your API calls wrong

LLMs guess at parameter names, payloads, and error shapes. Without typed contracts, every AI-generated API call is a coin flip.

Typed schemas AI can work with

Your SDK, types, and schemas give AI agents a complete contract for every endpoint. Code generation and agentic workflows become type-safe by default.

Why HyperFetch

One SDK. Any API.

Modern apps often require combining multiple tools for fetching, caching, realtime updates, and state synchronization. HyperFetch brings all of this into one system.

CLI

Schema → typed SDK

Point at any OpenAPI spec, get a fully typed client. No hand-written interfaces, no any.

OpenAPISwaggerTypeScriptZero any
openapi.json
schema source
24 endpoints
generated.ts typed
const user = await sdk
Learn more
Adapters

Any protocol, one API

REST, GraphQL, Firebase, Sockets. Swap the adapter, keep the same createRequest / .send() everywhere.

RESTGraphQLFirebaseSocketsSSE
Request
file_type_rest
REST
/users
200 OK
Your app
Typed data received
Learn more
Data layer

Production data layer

Cache, queue, retry, dedup, offline replay. All built in. Stop re-implementing the same infra in every project.

CacheQueueRetryDedupOffline
useFetch()
Cache
HIT
Queue
Adapter
Server
Online
cache HIT · instant
Learn more
Type safety

End-to-end TypeScript

Params inferred from URL strings. Typed responses, payloads, query params, errors. Zero any.

URL paramsResponsesPayloadsQueryErrors
React

React hooks built in

useFetch for queries. useSubmit for mutations. Loading, error, and data states all managed for you.

useFetchuseSubmitloadingerrordata
Devtools

HyperFlow DevTools

Inspect every request, cache entry, queue, and event. Debug your data layer visually.

NetworkCacheQueuesEvents
Runtimes

Runs everywhere

Browser, Node, edge, mobile, SSR. Same client, same behavior, every runtime.

BrowserNodeEdgeMobileSSR
Mutations

Optimistic updates

Mutate the UI first, reconcile with the server. Smooth, race-condition-free.

Mutate firstReconcileRace-safeRollback
Performance

Smart deduplication

Five components ask for the same data. One network call fires. Automatic.

Shared promiseOne requestAuto
Your API layer

One typed client for every API

HyperFetch replaces per-endpoint fetch wrappers with one typed SDK. REST, GraphQL, Firebase, WebSockets, and SSE all use the same createRequest() and .send() pattern. Cache, retries, queues, and offline replay are built in.

Any API
REST, GraphQL, Firebase, WebSockets, SSE. Five protocols. One typed request model. Swap the adapter, keep every line of app code.
Typed contract
Autocomplete from endpoint to error handler. Params, payloads, responses, query strings. If it compiles, it matches the API.
AI agents
Your AI agent calls the same typed .send() your React component does. One SDK for humans and machines.
Power up your development workflow

Meet HyperFlow Devtools

A standalone desktop app that plugs into your client. Inspect every request, cache entry, and queue as your app runs. Debug your data layer visually.

preview
Support the development.

Our wonderful sponsors

We're grateful to the following companies and individuals who have supported us financially. You can still help us by joining the GitHub Sponsors program or contact us for other ways of support or collaboration.

My Sponsors
Improve your workflow today

Build with HyperFetch

Spend less time on boilerplate and more on building amazing features that your users will love.