Getting started

Installation

One package, two peer dependencies, one optional.

shell
npm install @tesyl/hapi @tanstack/react-query

@tanstack/react-query and react are peer dependencies. zod is optional — hapi accepts any validator implementing safeParse or Standard Schema V1, so Zod is the most familiar option rather than a requirement.

PeerRangeRequired
@tanstack/react-query^5.0.0yes
react^18 || ^19yes
zod^3.22 || ^4no

Using a different validator

Anything implementing Standard Schema V1 works with no extra adapter and no dependency on hapi’s side.

any of these
responseSchema: z.object({ name: z.string() })          // Zod
responseSchema: v.object({ name: v.string() })          // Valibot
responseSchema: type({ name: 'string' })                // ArkType
responseSchema: Schema.standardSchemaV1(User)           // Effect Schema