Skip to main content

What is Kweri?

Kweri is a lightweight, framework-agnostic API client built around a stale-while-revalidate caching strategy. It gives you the ergonomics of TanStack Query without locking you into any specific framework — the same Kweri instance works in React, Vue, plain JavaScript, Node.js, and edge runtimes. At its core, Kweri manages three things:
  • Fetching — deduplicating concurrent requests for the same query
  • Caching — storing responses with configurable freshness and lifetime
  • Subscriptions — notifying any number of observers when cached data changes
Framework-specific hooks (React, Vue) are thin adapters layered on top. The cache logic itself has no dependency on any UI library.

Key features

Type-safe endpoints

Define endpoints once with TypeBox schemas. Parameter and response types are inferred automatically — no codegen needed for custom endpoints.

Smart caching

Stale-while-revalidate with per-instance staleTime and cacheTime. Fresh data is served instantly; stale data is background-refetched.

Request deduplication

Concurrent requests for the same query share a single in-flight promise. No duplicate network calls, ever.

Framework agnostic

Works with React (useSyncExternalStore), Vue (reactivity primitives), or raw subscriptions. One instance, any UI layer.

OpenAPI codegen

Run kweri-gen against any OpenAPI spec and get fully-typed client code and an EndpointByMethod map ready for path-based hooks.

Built-in DevTools

A floating DOM overlay shows the live cache, observer counts, in-flight requests, and a structured event log. Auto-disabled in production.

How it compares

Kweri is intentionally narrow in scope. It handles server state — fetching, caching, and synchronising remote data — not local UI state.
FeatureKweriTanStack QuerySWR
Framework agnostic core
TypeBox schema validation
OpenAPI codegen
Stale-while-revalidate
Built-in devtools
Bundle sizeSmallMediumSmall

Architecture overview