ky

Original🇺🇸 English
Translated

Tiny and elegant HTTP client based on the Fetch API for modern browsers, Node.js, Bun, and Deno

1installs
Added on

NPX Install

npx skill4agent add ono500/infra-ai ky

Tags

Translated version includes tags in frontmatter
该 skill 基于 Ky v1.14.3,生成于 2026-02-04。
Ky is a tiny and elegant HTTP client based on the Fetch API. It provides a simpler and more powerful API than plain fetch with no dependencies, targeting modern browsers, Node.js 18+, Bun, and Deno.

Core References

TopicDescriptionReference
Basic UsageHTTP method shortcuts, response body methods, TypeScript supportcore-usage
Core Optionsjson, searchParams, prefixUrl, timeout, methodcore-options

Features

Retry Mechanism

TopicDescriptionReference
Automatic RetryConfigurable retry strategies, delays, jitter, custom logicfeature-retry

Hooks System

TopicDescriptionReference
Lifecycle HooksbeforeRequest, beforeRetry, afterResponse, beforeError hooksfeature-hooks

Instance Management

TopicDescriptionReference
Custom Instancesky.create(), ky.extend(), context for hooksfeature-instances

Error Handling

TopicDescriptionReference
Error TypesHTTPError, TimeoutError, ForceRetryError, type guardsfeature-errors

Advanced

TopicDescriptionReference
Progress TrackingUpload and download progress callbacksadvanced-progress
CustomizationCustom JSON parsing/stringifying, custom fetchadvanced-customization

Best Practices

TopicDescriptionReference
Form Datamultipart/form-data, URL-encoded forms, file uploadbest-practices-form-data
CancellationAbortController for request cancellationbest-practices-cancellation
Node.js FeaturesProxy support, HTTP/2, environment configurationbest-practices-nodejs