CLIENT
v0.1.0 — Typed RPC client + codegen for Hyper.
$ hyper add client
Copies 7 files into src/hyper/client/ and updates hyper.lock.json.
DEPS
- registry: core
FILES
- client/client.ts
- client/codegen.ts
- client/index.ts
- client/sse.ts
- client/tanstack-query.ts
- client/transport.ts
- client/types.ts
README
@hyper/client
Typed RPC client + codegen for Hyper apps. Optional TanStack Query bindings at @hyper/client/tanstack-query.
Install
Components are installed as source into your repo, not pulled from npm:
bunx hyper add client
Wires the alias @hyper/client to src/hyper/client/ (configurable in hyper.config.json). See hyperjs.ai for the full registry.
Usage
Runtime client:
import { createClient, fetchTransport } from "@hyper/client"
const c = createClient(fetchTransport({ baseUrl: "https://api.example.com" }))
const res = await c.call({ method: "GET", path: "/users/:id", params: { id: "abc" } })
Type-safe client via codegen:
bun x hyper client ./src/generated/client.ts
import { client } from "./generated/client.ts"
const me = await client.users.show({ id: "abc" })
Docs
See the main README and docs/ for guides and integration recipes.
License
MIT
MANIFEST
- /r/client.json — latest
- /r/client@0.1.0.json — immutable