Skip to content

valifetchType-safe HTTP, built on native fetch

Validate responses, bodies, path params and search params with Valibot. Retries, hooks, timeouts, SSE and download progress included.

Install ​

bash
npm install valifetch valibot

Ten lines to a typed response ​

ts
import valifetch from 'valifetch';
import * as v from 'valibot';

const UserSchema = v.object({
  id: v.number(),
  name: v.string(),
  email: v.pipe(v.string(), v.email()),
});

const user = await valifetch.get('https://api.example.com/users/1', {
  responseSchema: UserSchema,
});
// user: { id: number; name: string; email: string }

If the server returns something that does not match the schema, the call rejects with a ValifetchError whose code is VALIDATION_ERROR.

For AI agents ​

A condensed, agent-oriented summary of the API is available at llms.txt.

Released under the MIT License. Built with Claude Code.