Ky wraps the Fetch API with retries, timeouts, JSON helpers, and method shortcuts. It runs in modern browsers, Node.js, Bun, and Deno without dependencies.
Overview
Ky is a small HTTP client built on the standard Fetch API. It adds conveniences missing from raw fetch, including HTTP verb shortcuts, treating non-2xx responses as errors, and optional automatic retries for failed requests.
Callers can send JSON bodies with a dedicated option, set request timeouts, track upload and download progress, and combine a base URL with relative paths. Custom instances support shared defaults and request hooks.
Retry behavior is configurable with limits, backoff, jitter, and custom shouldRetry logic. The client works with TypeScript generics on JSON parsing and can validate JSON responses with Standard Schema validators such as Zod.
Compared with using fetch directly, Ky reduces boilerplate for common REST patterns while staying close to native fetch options and Response handling.
Key features
- Fetch API wrapper with verb shortcuts
- Automatic retry with backoff and jitter
- JSON body and parsing helpers
- Request timeout support
- Upload and download progress
- Custom instances and hooks
- TypeScript-friendly JSON typing
- Zero runtime dependencies
Use cases
- REST calls in browser front ends
- HTTP requests in Node or Deno
- API clients with shared base URL
- Validated JSON responses