Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

hyper-fetch

> 前端框架
Open source

⚡ Fetching and realtime data exchange framework.

1.3K stars0 likes1 views
WebsiteGitHub

About

⚡ Fetching and realtime data exchange framework.

Quick Start

Define requests manually

typescript
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()({
  endpoint: "/users",
  method: "GET",
});

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

Or generate from OpenAPI

bash
npx @hyper-fetch/cli generate --url https://api.example.com/openapi.json
typescript
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

Try other BetterTyped projects

Hyper Fetch is the data layer inside Hype Stack, the full-stack template I build alongside it.

Packages

Package Version Downloads Size
@hyper-fetch/core
@hyper-fetch/react
@hyper-fetch/sockets
@hyper-fetch/cli
@hyper-fetch/firebase
@hyper-fetch/firebase-admin
@hyper-fetch/graphql
@hyper-fetch/axios
@hyper-fetch/plugin-devtools

Examples

Fetching data

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

Mutation with params and payload

typescript
// 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: "[email protected]" },
});

React hooks

typescript
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 
{data?.map((u) => 
{u.name}
)}
;
};

Documentation

  • Getting Started
  • Core Concepts
  • React Integration
  • CLI & SDK Generation
  • API Reference
  • Guides

Our sponsors

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptajaxbuildercachedata-exchange

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架