Zod-powered HTTP schema library for strongly typed client-server communication. Version 2.0.5, stable. Combines runtime validation from zod with compile-time types for HTTP request and response shapes. Supports path parameters, request body, and response body schemas. Differentiates from plain zod by providing a unified schema definition for both client and server, automatic response trimming to prevent data leaks, and a client using Axios. Key differentiator: single source of truth for API contracts across client and server, with TypeScript type inference.
npm install zod-http-schemasVerified import paths — ran on the pinned version, not inferred.
Creates a shared HTTP schema and uses the client to make two typed requests.
Update client configuration options to align with Axios: baseURL, headers, etc.
Change import to import { createHttpClient } from 'zod-http-schemas/client'.Ensure responseBody schema includes all properties you want to keep.
Verify route string has matching placeholders and params object keys.
Upgrade to zod@^3 and update any custom schemas to zod v3 API.
Use TypeScript 4.7+ with moduleResolution 'node16' or 'bundler', or add a path mapping.
Switch to dynamic import: const { createHttpSchema } = await import('zod-http-schemas');Access response data via result.data instead of result.body in client code.