valifetch
Valifetch — a type-safe HTTP client built on native fetch with Valibot schema validation.
Example
ts
import valifetch from 'valifetch';
import * as v from 'valibot';
const UserSchema = v.object({ id: v.number(), name: v.string() });
const user = await valifetch.get('/users/1', { responseSchema: UserSchema });All public types, including the valifetch/auth and valifetch/mock option types, are also available from the zero-runtime valifetch/types entry point.
Classes
Type Aliases
- AfterParseResponseHook
- AfterResponseHook
- BeforeErrorHook
- BeforeRequestHook
- BeforeRetryHook
- BeforeRetryState
- CallableInstance
- CancellablePromise
- DebugEvent
- DebugOption
- DownloadProgressEvent
- ErrorCode
- ExtractPathParams
- GetOptions
- HasPathParams
- Hooks
- HttpMethod
- InferResponseType
- NormalizedOptions
- PathParamsRecord
- PostOptions
- RawBody
- ResponseType
- RetryContext
- RetryOptions
- SearchParamsInit
- ValidationErrorInfo
- ValidationTarget
- ValifetchBaseOptions
- ValifetchErrorOptions
- ValifetchInstance
- ValifetchInstanceOptions
- ValifetchOptions