Skip to main content
TypeScript Fetch Request Builder

Readable requests,
explicit execution.

dench-fetch keeps the flexibility of the native Fetch API while organizing repetitive request options into short, type-safe chains.

Built on Fetch APIType supportExplicit execution
Dench logo
dench-fetchSmall chain. Clear request.
request.tsREADY
const user = await api
  .get<User>('/users/1')
  .auth(token)
  .timeout(3000)
  .toJson();
GET/users/1200

Keep the power of fetch,
with a lighter authoring experience.

dench-fetch is a TypeScript request builder built on the native Fetch API. Compose requests with short, readable chains instead of complex configuration objects, then execute them explicitly when needed.

request.tsdench-fetch
const user = await api
  .get<User>('/users/1')
  .auth('access-token')
  .timeout(3000)
  .toJson();
The request that gets createdREADY
GEThttps://api.example.com/users/1
Authorization
Bearer access-token
Timeout
3,000ms
Returns
Promise<User>
01READABLE CHAIN

Requests read like their intent

Write the request flow naturally from top to bottom, from the HTTP method through authentication, timeout, and response format.

.get<User>('/users/1')
.auth(token)
.timeout(3000)
.toJson()
02EXPLICIT RUNNER

Make the execution point explicit

Building a request does not send it. The actual fetch runs only when you select the response format.

.toJson()
.toResponse()
.toFormData()
03BODY HELPERS

Choose body formats without the boilerplate

Set JSON, FormData, Blob, URL-encoded data, or a raw body with a method designed for that format.

.sendJson(data)
.sendForm(form)
.sendBlob(blob)
04REUSABLE BUILDER

Configure shared options once

Copy a builder with authentication and timeout settings, then change only the API path to reduce repetition.

common.copy().api('/users')
common.copy().api('/posts')
$npm install dench-fetch
Start with the docs