Kinetex is an early-stage universal HTTP client designed for a wide range of JavaScript runtimes, including Node.js (v18+), browsers, Deno, Bun, and Cloudflare Workers. Currently at version `0.0.2`, it aims to provide a comprehensive solution with built-in support for advanced features such as HTTP/2 and HTTP/3, schema validation (via Zod or Valibot), a flexible middleware system, and integrated utilities for caching, request deduplication, retries, HAR recording, Server-Sent Events (SSE), and GraphQL. Its key differentiators include its broad runtime compatibility, modern HTTP protocol support, and extensive feature set that often requires multiple separate libraries in other HTTP clients. The project is in active, rapid development, and API stability cannot be guaranteed at this early stage.
npm install kinetexVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing the default `kinetex` instance, defining a custom middleware, and performing a GET request with Zod schema validation for the response body. It also includes basic error handling for validation and network issues.
Review the changelog and GitHub issues for each update. Pin exact versions for production use and dedicate time for migration when updating.
Install required peer dependencies alongside Kinetex: `npm install kinetex zod undici valibot socks-proxy-agent` (install only those relevant to your use case).
Ensure your project runs on Node.js 18+ and is configured as an ESM module (e.g., by adding `"type": "module"` to your `package.json` or using `.mjs` file extensions).
Install Zod as a direct dependency: `npm install zod`.
Configure your project for ESM by adding `"type": "module"` to your `package.json`, ensure your Node.js version is >=18, and use `import` statements.
Ensure you correctly import the default Kinetex instance: `import kinetex from 'kinetex';`