default

A lightweight HTTP client built on fetch with automatic retries, configurable timeouts, and rate-limit handling via Retry-After.

Examples

Fetch JSON with retries and a timeout

import { WebClient } from "@anabranch/web-client";

const client = WebClient.create()
  .withBaseUrl("https://api.example.com")
  .withTimeout(10_000)
  .withRetry({ attempts: 3 });

const user = await client.get("/users/1").map(r => r.data).run();

Classes

c
WebClient(config: ResolvedConfig)

An HTTP client built on fetch with automatic retries and error handling.

Interfaces

Type Aliases

T