@freqhole/api-client
v0.1.31
Published
type-safe TypeScript client for freqhole APIs.
Readme
@freqhole/api-client
type-safe TypeScript client for freqhole APIs.
this package wraps generated route + schema metadata with a small runtime client so requests are validated and typed on both input and output.
install
npm i @freqhole/api-clientfor local monorepo usage, this repo usually links it by file path.
quick start
import { createHttpClient } from "@freqhole/api-client";
const api = createHttpClient({
baseUrl: "http://localhost:4315",
});
const songs = await api.music.listSongs({
query: { limit: 25, offset: 0 },
});
if (songs.success) {
console.log(songs.data.songs.length);
}package structure
src/codegen/schema.ts: generated zod schemassrc/codegen/routes.ts: generated route metadatasrc/*.ts: hand-written helpers and client adapters
avoid editing files under src/codegen/ directly.
development notes
if you are working in this repo and need to regenerate types/routes, run codegen from client-codegen/.
the full generator workflow and architecture docs live in client-codegen/README.md.
made with 💖 in NYC
