Skip to main content
Version: v10.5.1

Installation

Every setup starts with @hyper-fetch/core. Add the packages for your framework, transport and tooling on top of it.

npm install @hyper-fetch/core

Add the lint plugin​

The request generics are objects (createRequest<{ response: User }>()), and TypeScript accepts unknown keys in them without an error. The lint plugin reports misspelled or unknown generic keys, so install it next to core.

npm install --save-dev eslint-plugin-hyper-fetch

Using Oxlint? Install oxlint-plugin-hyper-fetch instead. It has the same rules. Setup for both is on the ESLint plugin page.


Add your framework​

React hooks (useFetch, useSubmit and the others) need React 18 or newer.

npm install @hyper-fetch/core @hyper-fetch/react

For WebSocket and server-sent events, add sockets. It works with or without React.

npm install @hyper-fetch/sockets

All packages​

PackageWhat it adds
@hyper-fetch/coreClient, requests, cache, dispatchers and the fetch adapter
@hyper-fetch/reactReact hooks and the Hydrate component
@hyper-fetch/socketsRealtime listeners and emitters over WebSocket and SSE
@hyper-fetch/dbCollections of typed rows with live queries and optimistic writes
@hyper-fetch/axiosAxios adapter, with upload progress in the browser
@hyper-fetch/graphqlGraphQL adapter for queries, mutations and subscriptions
@hyper-fetch/firebaseFirestore and Realtime Database adapter for the client SDK
@hyper-fetch/firebase-adminThe same adapter for the Firebase Admin SDK on the server
@hyper-fetch/trpcTyped requests from a tRPC router
@hyper-fetch/orpcTyped requests from an oRPC router
@hyper-fetch/honoA typed SDK from a Hono app type
@hyper-fetch/elysiaA typed SDK from an Elysia app type
@hyper-fetch/plugin-devtoolsConnects a client to the HyperFlow devtools app
@hyper-fetch/cliGenerates a typed SDK from an OpenAPI or Swagger schema
eslint-plugin-hyper-fetchLint rules for request and client generics
oxlint-plugin-hyper-fetchThe same lint rules for Oxlint

Next​