ky breaking changes
Updated December 4, 2026
On this page
Latest version 2.2.0, released October 9, 2026. Source repository
Its 2.0.0 release requires Node.js 22 or later. Node.js end of life dates.
- From 1.0.0 to 2.2.0: 97 breaking changes in 3 versions.
- From 0.31.0 to 2.2.0: 111 breaking changes in 4 versions.
ky 2.2.0 breaking changes
- Behavior changed
hooks.beforeError
beforeError hooks now also run for errors thrown while reading the response body, and a dropped connection during body reads is now a NetworkError. github.com - Behavior changed
hooks.beforeRetry
When retry.shouldRetry returns true, the Retry-After and rate-limit headers are now respected for the wait before retrying. github.com - Behavior changed
hooks.init
In init hooks, options.headers names are lowercase, so code reading or deleting headers must use lowercase names. github.com - Behavior changed
options.timeout
Invalid options such as null, non-array hooks, and invalid timeout or retry values now throw a TypeError that rejects the returned promise instead of throwing synchronously. github.com - Behavior changed
totalTimeout
totalTimeout is now enforced when the response or body arrives after the deadline, and user aborts are no longer reported as NetworkError and retried in Chromium. github.com - Signature changed
BeforeRetryHook
Was type BeforeRetryHook = (state: BeforeRetryState) => Request | Response | typeof stop | void | Promise<Request | Response | typeof stop | void>; now type BeforeRetryHook = (state: BeforeRetryState) => Request | Response |... npmjs.com - Signature changed
ForceRetryError.name
Was name: "ForceRetryError"; now name: string. npmjs.com - Signature changed
Hooks
Was type Hooks = {init?: InitHook[]; beforeRequest?: BeforeRequestHook[]; beforeRetry?: BeforeRetryHook[]; beforeError?: BeforeErrorHook[]; afterResponse?: AfterResponseHook[];}; now type Hooks = {init?: readonly InitHook[] | undefined... npmjs.com - Signature changed
Hooks.afterResponse
Was afterResponse?: AfterResponseHook[]; now afterResponse?: readonly AfterResponseHook[] | undefined. npmjs.com - Signature changed
Hooks.beforeError
Was beforeError?: BeforeErrorHook[]; now beforeError?: readonly BeforeErrorHook[] | undefined. npmjs.com - Signature changed
Hooks.beforeRequest
Was beforeRequest?: BeforeRequestHook[]; now beforeRequest?: readonly BeforeRequestHook[] | undefined. npmjs.com - Signature changed
Hooks.beforeRetry
Was beforeRetry?: BeforeRetryHook[]; now beforeRetry?: readonly BeforeRetryHook[] | undefined. npmjs.com - Signature changed
Hooks.init
Was init?: InitHook[]; now init?: readonly InitHook[] | undefined. npmjs.com - Signature changed
HTTPError.name
Was name: "HTTPError"; now name: string. npmjs.com - Signature changed
InitHook
Was type InitHook = (options: Options) => void; now type InitHook = (options: InitOptions) => void. npmjs.com - Signature changed
KyRequest
Was type KyRequest<T = unknown> = {json: <J = T>() => Promise<J>;} & Request; now type KyRequest<T = unknown> = {clone: () => KyRequest<T>; json: <J = T>() => Promise<J>;} & Request. npmjs.com - Signature changed
KyResponse
Was type KyResponse<T = unknown> = {json: <J = T>() => Promise<J>;} & Response; now type KyResponse<T = unknown> = {clone: () => KyResponse<T>; json: <J = T>() => Promise<J>;} & Response. npmjs.com - Signature changed
NetworkError.constructor
Was constructor(request: Request, options?: {cause?: Error;}); now constructor(request: Request, options?: {cause?: Error | undefined;}). npmjs.com - Signature changed
NetworkError.name
Was name: "NetworkError"; now name: string. npmjs.com - Signature changed
Options
Was interface Options extends KyOptions, Omit<RequestInit, 'headers'>; now interface Options extends KyOptions, RequestOptions. npmjs.com - Signature changed
Options.baseUrl
Was baseUrl?: URL | string; now baseUrl?: URL | string | undefined. npmjs.com - Signature changed
Options.context
Was context?: Record<string, unknown>; now context?: Record<string, unknown> | undefined. npmjs.com - Signature changed
Options.fetch
Was fetch?: (input: Input, init?: RequestInit) => Promise<Response>; now fetch?: ((input: Request, init?: RequestInit) => Promise<Response>) | undefined. npmjs.com - Signature changed
Options.headers
Was headers?: KyHeadersInit; now headers?: KyHeadersInit | undefined. npmjs.com - Signature changed
Options.hooks
Was hooks?: Hooks; now hooks?: Hooks | undefined. npmjs.com - Signature changed
Options.method
Was method?: LiteralUnion<HttpMethod, string>; now method?: LiteralUnion<HttpMethod, string> | undefined. npmjs.com - Signature changed
Options.onDownloadProgress
Was onDownloadProgress?: (progress: Progress, chunk: Uint8Array) => void; now onDownloadProgress?: ((progress: Progress, chunk: Uint8Array) => void) | undefined. npmjs.com - Signature changed
Options.onUploadProgress
Was onUploadProgress?: (progress: Progress, chunk: Uint8Array) => void; now onUploadProgress?: ((progress: Progress, chunk: Uint8Array) => void) | undefined. npmjs.com - Signature changed
Options.parseJson
Was parseJson?: (text: string, context: {request: Request; response: Response;}) => unknown; now parseJson?: ((text: string, context: {request: Request; response: Response;}) => unknown) | undefined. npmjs.com - Signature changed
Options.prefix
Was prefix?: URL | string; now prefix?: URL | string | undefined. npmjs.com - Signature changed
Options.retry
Was retry?: RetryOptions | number; now retry?: RetryOptions | number | undefined. npmjs.com - Signature changed
Options.stringifyJson
Was stringifyJson?: (data: unknown) => string; now stringifyJson?: ((data: unknown) => string) | undefined. npmjs.com - Signature changed
Options.throwHttpErrors
Was throwHttpErrors?: boolean | ((status: number) => boolean); now throwHttpErrors?: boolean | ((status: number) => boolean) | undefined. npmjs.com - Signature changed
Options.timeout
Was timeout?: number | false; now timeout?: number | false | undefined. npmjs.com - Signature changed
Options.totalTimeout
Was totalTimeout?: number | false; now totalTimeout?: number | false | undefined. npmjs.com - Signature changed
ResponsePromise
Was type ResponsePromise<T = unknown> = {arrayBuffer: () => Promise<ArrayBuffer>; blob: () => Promise<Blob>; formData: () => Promise<FormData>; bytes: () => Promise<Uint8Array>; json: {<JsonType = T>(): Promise<JsonType>; <Schema extends... npmjs.com - Signature changed
ResponsePromise.bytes
Was bytes: () => Promise<Uint8Array>; now bytes: () => Promise<Uint8Array<ArrayBuffer>>. npmjs.com - Signature changed
ResponsePromise.json
Was json: {<JsonType = T>(): Promise<JsonType>; <Schema extends StandardSchemaV1>(schema: Schema): Promise<StandardSchemaV1InferOutput<Schema>>;}; now json: {<JsonType = T>(schema?: undefined): Promise<JsonType>; <Schema extends... npmjs.com - Signature changed
RetryOptions
Was type RetryOptions = {limit?: number; methods?: HttpMethod[]; statusCodes?: number[]; afterStatusCodes?: number[]; maxRetryAfter?: number; backoffLimit?: number; delay?: (attemptCount: number) => number; jitter?: boolean | ((delay... npmjs.com - Signature changed
RetryOptions.afterStatusCodes
Was afterStatusCodes?: number[]; now afterStatusCodes?: readonly number[] | undefined. npmjs.com - Signature changed
RetryOptions.backoffLimit
Was backoffLimit?: number; now backoffLimit?: number | undefined. npmjs.com - Signature changed
RetryOptions.delay
Was delay?: (attemptCount: number) => number; now delay?: ((attemptCount: number) => number) | undefined. npmjs.com - Signature changed
RetryOptions.limit
Was limit?: number; now limit?: number | undefined. npmjs.com - Signature changed
RetryOptions.maxRetryAfter
Was maxRetryAfter?: number; now maxRetryAfter?: number | undefined. npmjs.com - Signature changed
RetryOptions.methods
Was methods?: HttpMethod[]; now methods?: readonly HttpMethod[] | undefined. npmjs.com - Signature changed
RetryOptions.retryOnTimeout
Was retryOnTimeout?: boolean; now retryOnTimeout?: boolean | undefined. npmjs.com - Signature changed
RetryOptions.shouldRetry
Was shouldRetry?: (state: ShouldRetryState) => boolean | undefined | Promise<boolean | undefined>; now shouldRetry?: ((state: ShouldRetryState) => boolean | void | Promise<boolean | void>) | undefined. npmjs.com - Signature changed
RetryOptions.statusCodes
Was statusCodes?: number[]; now statusCodes?: readonly number[] | undefined. npmjs.com - Signature changed
SchemaValidationError.name
Was name: "SchemaValidationError"; now name: string. npmjs.com - Signature changed
SearchParamsOption
Was type SearchParamsOption = SearchParamsInit | Record<string, string | number | boolean | undefined> | Array<Array<string | number | boolean>>; now type SearchParamsOption = Exclude<SearchParamsInit, string[][]> | Record<string, string |... npmjs.com
And 1 more in this version. Sign up to see every change
ky 2.1.0 breaking changes
- Behavior changed
baseUrl
Malformed HTTP URLs given to baseUrl are now rejected instead of being accepted, so make sure the URLs you pass are valid. github.com - Signature changed
AfterResponseState
Was type AfterResponseState = {request: KyRequest; options: NormalizedOptions; response: KyResponse; retryCount: number;}; now type AfterResponseState = {request: KyRequest; options: Readonly<NormalizedOptions>; response: KyResponse... npmjs.com - Signature changed
AfterResponseState.options
Was options: NormalizedOptions; now options: Readonly<NormalizedOptions>. npmjs.com - Signature changed
BeforeErrorState
Was type BeforeErrorState = {request: KyRequest; options: NormalizedOptions; error: Error; retryCount: number;}; now type BeforeErrorState = {request: KyRequest; options: Readonly<NormalizedOptions>; error: Error; retryCount: number;}. npmjs.com - Signature changed
BeforeErrorState.options
Was options: NormalizedOptions; now options: Readonly<NormalizedOptions>. npmjs.com - Signature changed
BeforeRequestState
Was type BeforeRequestState = {request: KyRequest; options: NormalizedOptions; retryCount: 0;}; now type BeforeRequestState = {request: KyRequest; options: Readonly<NormalizedOptions>; retryCount: 0;}. npmjs.com - Signature changed
BeforeRequestState.options
Was options: NormalizedOptions; now options: Readonly<NormalizedOptions>. npmjs.com - Signature changed
BeforeRetryState
Was type BeforeRetryState = {request: KyRequest; options: NormalizedOptions; error: Error; retryCount: number;}; now type BeforeRetryState = {request: KyRequest; options: Readonly<NormalizedOptions>; error: Error; retryCount: number;}. npmjs.com - Signature changed
BeforeRetryState.options
Was options: NormalizedOptions; now options: Readonly<NormalizedOptions>. npmjs.com - Signature changed
HTTPError.constructor
Was constructor(response: Response, request: Request, options: NormalizedOptions); now constructor(response: Response, request: Request, options: Readonly<NormalizedOptions>). npmjs.com
And 11 more in this version. Sign up to see every change
ky 2.0.0 breaking changes
- Removed
Ky 2.0 requires Node.js 22; older Node.js versions must upgrade before using this release. github.com - Removed
Options.prefixUrl
Replace the prefixUrl option with prefix; leading slashes in input are now allowed. npmjs.com - Behavior changed
beforeError
Hook receives every error type, so check with isHTTPError before reading response fields. github.com - Behavior changed
hooks
Errors thrown inside hooks are no longer swallowed outside retry handling. github.com - Behavior changed
json
Empty responses no longer return an empty string; check the status before calling json(). github.com - Behavior changed
searchParams
Existing query parameters in the input URL are kept and merged with searchParams. github.com - Signature changed
AfterResponseHook
Was type AfterResponseHook = (request: KyRequest, options: NormalizedOptions, response: KyResponse, state: AfterResponseState) => Response | RetryMarker | void | Promise<Response | RetryMarker | void>; now type AfterResponseHook = (state... npmjs.com - Signature changed
AfterResponseState
Was type AfterResponseState = {retryCount: number;}; now type AfterResponseState = {request: KyRequest; options: NormalizedOptions; response: KyResponse; retryCount: number;}. npmjs.com - Signature changed
BeforeErrorHook
Was type BeforeErrorHook = (error: HTTPError, state: BeforeErrorState) => HTTPError | Promise<HTTPError>; now type BeforeErrorHook = (state: BeforeErrorState) => Error | Promise<Error>. npmjs.com - Signature changed
BeforeErrorState
Was type BeforeErrorState = {retryCount: number;}; now type BeforeErrorState = {request: KyRequest; options: NormalizedOptions; error: Error; retryCount: number;}. npmjs.com
And 15 more in this version. Sign up to see every change
ky 1.0.0 breaking changes
- Removed
The release requires Node.js 18 or later when used in Node.js. Users on older Node.js versions must upgrade Node.js before using this release. github.com - Removed
KyResponse.json
KyResponse.json was removed in ky 1.0.0 npmjs.com - Removed
NormalizedOptions.credentials
NormalizedOptions.credentials was removed in ky 1.0.0 npmjs.com - Removed
NormalizedOptions.method
NormalizedOptions.method was removed in ky 1.0.0 npmjs.com - Removed
NormalizedOptions.onDownloadProgress
NormalizedOptions.onDownloadProgress was removed in ky 1.0.0 npmjs.com - Removed
NormalizedOptions.prefixUrl
NormalizedOptions.prefixUrl was removed in ky 1.0.0 npmjs.com - Removed
NormalizedOptions.retry
NormalizedOptions.retry was removed in ky 1.0.0 npmjs.com - Signature changed
DownloadProgress
Was interface DownloadProgress; now type DownloadProgress = {percent: number; transferredBytes: number; totalBytes: number;}. npmjs.com - Signature changed
Hooks
Was interface Hooks; now type Hooks = {beforeRequest?: BeforeRequestHook[]; beforeRetry?: BeforeRetryHook[]; afterResponse?: AfterResponseHook[]; beforeError?: BeforeErrorHook[];}. npmjs.com - Signature changed
KyResponse
Was interface KyResponse extends Response; now type KyResponse = {json: <T = unknown>() => Promise<T>;} & Response. npmjs.com
And 4 more in this version. Sign up to see every change
ky 0.31.0 breaking changes
- Behavior changed
The package now requires Node.js 14 or later when used in Node.js. Users on older Node.js versions must upgrade. github.com - Signature changed
ResponsePromise
Was interface ResponsePromise extends Promise<Response>; now interface ResponsePromise extends Promise<KyResponse>. npmjs.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.