What problem does it solve?
Frontend teams often struggle with scattered API calls, inconsistent typing, weak validation, and noisy error handling that makes UI states unpredictable and hard to maintain.
Core Features & Use Cases
- Deterministic HTTP layer with ky: Centralizes request configuration (timeouts, retries) and response/error hooks so auth and error parsing behave consistently.
- Typed service functions with Zod: Ensures every API response is schema-validated via zod.parse, turning malformed payloads into clear query/mutation error states.
- Scalable React Query queryOptions pattern: Standardizes query keys, query options, cache invalidation, and mutation side effects to keep data fresh without manual wiring.
- Form validation with React Hook Form + Zod: Applies the same schema-driven approach to user input validation, including dynamic arrays via useFieldArray.
- Multi-transport consistency (Socket.io): Reuses Zod schemas to validate outbound socket emits before sending, even when the ky/React Query stack is bypassed.
Quick Start
Implement your new endpoint by adding a Zod-validated service function, then expose it as a queryOptions factory with a stable queryKey, and finally consume it with useQuery while letting React Query surface typed validation failures automatically.