MCPcopy Index your code
hub / github.com/BetterTyped/hyper-fetch

github.com/BetterTyped/hyper-fetch @eslint-hyper-fetch-v8.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release eslint-hyper-fetch-v8.2.0 ↗ · + Follow
1,860 symbols 7,255 edges 1,187 files 38 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Hyper Fetch

Hyper Fetch

One SDK. Any API. Fully typed.

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.

Documentation | Quick Start | Guides

Quick Start

Define requests manually

import { createClient } from "@hyper-fetch/core";

// Create a client — this is the single entry point for all your API calls
const client = createClient({ url: "https://api.example.com" });

// Define a typed request — response shape is inferred everywhere from here
const getUsers = client.createRequest<{ response: { id: number; name: string }[] }>()({
  endpoint: "/users",
  method: "GET",
});

// Send it — data, error, and status are fully typed
const { data, error, status } = await getUsers.send();

Or generate from OpenAPI

npx @hyper-fetch/cli generate --url https://api.example.com/openapi.json
import { sdk } from "./generated";

// Every endpoint from your schema is available as a typed method
const { data } = await sdk.users.list.send();

Why HyperFetch?

  • 🔮 Zero guesswork — End-to-end TypeScript types from schema to response, full autocompletion, zero any
  • 📡 One interface for everything — REST, GraphQL, Firebase, WebSockets, SSE — stop learning a new library for each API
  • 💾 Data management built in — Caching, queuing, offline support, retries, and deduplication out of the box
  • Works everywhere — React, Next.js, Remix, Astro, Node.js, Bun — same API, every environment

<a href="https://github.com/sponsors/prc5?tier=Platinum">



        <img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/assets/Platinum.png" alt="Platinum sponsor banner"/>



</a>







<a href="https://github.com/sponsors/prc5?tier=Platinum">



        <img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/packages/platinum/sponsorkit/sponsors.svg" alt="Platinum sponsors"/>



</a>

Packages

Package Version Downloads Size
@hyper-fetch/core npm downloads size
@hyper-fetch/react npm downloads size
@hyper-fetch/sockets npm downloads size
@hyper-fetch/cli npm downloads size
@hyper-fetch/firebase npm downloads size
@hyper-fetch/firebase-admin npm downloads size
@hyper-fetch/graphql npm downloads size
@hyper-fetch/axios npm downloads size
@hyper-fetch/plugin-devtools npm downloads size
<a href="https://github.com/sponsors/prc5?tier=Gold">



        <img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/assets/Gold.png" alt="Gold sponsor banner"/>



</a>







<a href="https://github.com/sponsors/prc5?tier=Gold">



        <img width="830" src="https://raw.githubusercontent.com/prc5/sponsors/main/packages/gold/sponsorkit/sponsors.svg" alt="Gold sponsors"/>



</a>

Examples

Fetching data

// Send and destructure — all return values are typed
const { data, error, status } = await getUsers.send();

Mutation with params and payload

// Params go in the URL, data goes in the body — both fully typed
const { data, error, status } = await createUser.send({
  params: { teamId: 1 },
  data: { name: "Jane", email: "jane@example.com" },
});

React hooks

import { useFetch } from "@hyper-fetch/react";

const UserList = () => {
  // useFetch triggers the request on mount and returns typed state
  const { data, loading, error } = useFetch(getUsers);

  if (loading) return 

Loading...

;
  if (error) return 

Error loading users

;
  return <ul>{data?.map((u) => <li key={u.id}>{u.name}</li>)}</ul>;
};

Documentation

Our sponsors

<a href="https://github.com/sponsors/prc5">
    <img src="https://raw.githubusercontent.com/prc5/sponsors/main/packages/other/sponsorkit/sponsors.svg?raw=true" alt="Sponsors" />
</a>

License

MIT

Extension points exported contracts — how you extend this code

AbortController (Interface)
A controller object that allows you to abort one or more DOM requests as and when desired.
global.d.ts
DotPatternProps (Interface)
* DotPattern Component Props * * @param {number} [width=16] - The horizontal spacing between dots * @param {number}
packages/hyper-flow/src/frontend/components/ui/dot-pattern.tsx
DotPatternProps (Interface)
* DotPattern Component Props * * @param {number} [width=16] - The horizontal spacing between dots * @param {number}
documentation/src/components/ui/dot-pattern.tsx
Assertion (Interface)
(no doc)
vitest.d.ts
ErrorBoundaryProps (Interface)
(no doc)
packages/react/__tests__/features/use-fetch/use-fetch.suspense.spec.tsx
BaseMessagePayload (Interface)
(no doc)
packages/plugin-devtools/src/types/messages.types.ts
RequestHooks (Interface)
(no doc)
packages/core/src/request/request.hooks.ts
RefError (Interface)
(no doc)
packages/cli/src/codegen/openapi/generator.ts

Core symbols most depended-on inside this repo

mockRequest
called by 395
packages/testing/src/http/http.ts
cn
called by 237
packages/hyper-flow/src/frontend/lib/utils.ts
setParams
called by 168
packages/sockets/src/emitter/emitter.ts
sleep
called by 154
packages/testing/src/index.ts
startServer
called by 137
packages/testing/src/sse/sse.ts
stopServer
called by 117
packages/testing/src/sse/sse.ts
emit
called by 100
packages/core/src/utils/emitter.utils.ts
clone
called by 98
packages/core/src/request/request.ts

Shape

Function 1,577
Method 95
Interface 92
Class 66
Enum 30

Languages

TypeScript100%

Modules by API surface

packages/core/src/managers/request/request.manager.utils.ts29 symbols
packages/hyper-flow/src/frontend/components/ui/sidebar.tsx25 symbols
packages/core/src/adapter/adapter.bindings.ts21 symbols
packages/testing/src/e2e/e2e.websocket-server.ts19 symbols
packages/core/src/adapter/adapter.utils.ts19 symbols
packages/testing/src/e2e/e2e.server.ts17 symbols
packages/hyper-flow/src/shared/utils/logger.ts17 symbols
packages/sockets/src/socket/socket.utils.ts16 symbols
packages/react/src/helpers/use-request-events/use-request-events.hooks.ts16 symbols
packages/react/__tests__/features/use-fetch/use-fetch.suspense.spec.tsx16 symbols
packages/hyper-flow/src/frontend/components/ui/particles.tsx16 symbols
documentation/src/components/particles/particles.tsx16 symbols

For agents

$ claude mcp add hyper-fetch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page