Rezo HTTP Client
raw JSON → 1.0.133 verified Mon Apr 27 auth: no javascript
Rezo (v1.0.133) is an enterprise-grade HTTP client for JavaScript/TypeScript, supporting Node.js 22+, Bun, Deno, browsers, React Native, and edge runtimes. It features 6 adapters (HTTP, HTTP/2, cURL, Fetch, XHR, React Native) with automatic selection, full HTTP/2 support, intelligent cookie management, proxy rotation (HTTP/HTTPS/SOCKS), stealth mode with browser TLS fingerprinting, web crawling with SQLite persistence, request queuing, streaming, and 70+ structured error codes. Published on npm with weekly releases, it differentiates itself from alternatives like Axios or Got by providing a unified API across environments, built-in proxy rotation, and advanced web crawling capabilities.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module ↓
cause Rezo is ESM-only; CommonJS require() not allowed.
fix
Change const rezo = require('rezo') to import rezo from 'rezo'
error TypeError: rezo.postJson is not a function ↓
cause Using default import incorrectly on an instance without .postJson method.
fix
Ensure you import the default export: import rezo from 'rezo'
error Unhandled Rejection - RezoError: Request failed with status code 404 - Resource not found ↓
cause Server returned 404; RezoError includes code and status.
fix
Catch RezoError and check .status or .code for structured handling.
Warnings
gotcha Rezo is pure ESM and requires Node.js >= 22. Using require() will throw ERR_REQUIRE_ESM. ↓
fix Use import syntax or dynamic import() in CommonJS modules.
gotcha Adapters are auto-selected but the default may not support cookies in all runtimes (e.g., Fetch adapter in browsers lacks cookie support). ↓
fix Explicitly select adapter via adapter option or use create() with adapter: 'http' or 'http2' for Node.js.
breaking Major version 1.0.0 introduced breaking changes from earlier alphas: removed synchronous methods, changed error class names. ↓
fix Migrate to async/await and use RezoError instead of old Error subclasses.
Install
npm install rezo yarn add rezo pnpm add rezo Imports
- default wrong
const rezo = require('rezo')correctimport rezo from 'rezo' - Rezo wrong
import Rezo from 'rezo'correctimport { Rezo } from 'rezo' - RezoError wrong
import RezoError from 'rezo'correctimport { RezoError } from 'rezo' - type definitions
import type { RezoConfig, RezoRequestConfig, RezoResponse } from 'rezo'
Quickstart
import rezo from 'rezo';
// GET request
const { data } = await rezo('https://jsonplaceholder.typicode.com/posts');
console.log(data);
// POST with JSON
const { data: user } = await rezo.postJson('https://jsonplaceholder.typicode.com/users', {
name: 'Ada Lovelace',
email: 'ada@example.com'
});
// Create instance with base URL
const client = rezo.create({
baseURL: 'https://jsonplaceholder.typicode.com',
timeout: 5000
});
// GET via instance
const { data: posts } = await client.get('/posts');
// Error handling
try {
await rezo('https://invalid.url');
} catch (err) {
console.error(err.name, err.message);
}