$ show IdoPesok/zsa
This is a TypeScript library providing a builder API for typesafe Next.js server actions with Zod validation. It is structured as a monorepo with core package `zsa`, React hooks (`zsa-react`), React Query integration (`zsa-react-query`), and OpenAPI exposure (`zsa-openapi`). The core library supports input validation (JSON, FormData, useActionState), procedures for middleware chaining with context propagation, typed error handling via `ZSAError`, configurable retries and timeouts, and client-side hooks (`useServerAction`, `useActionState`). The OpenAPI module generates REST endpoints and OpenAPI specifications from server actions. The codebase is well-organized with fluent builder patterns, comprehensive test coverage (Jest + Playwright), and a documentation site using Fumadocs. However, it is a personal project currently lacking support for Next.js 15, and all packages are pre-1.0 (0.x), indicating potential instability and limited maintenance commitment.
The LLM identified 2 files worth highlighting for reuse:
Defines `ZSAError` class with typed error codes and optional data payload. This is a self-contained, reusable error-handling pattern that can be extracted and used in any TypeScript project needing structured, typed error handling without depending on the rest of the ZSA library.
Defines callback interfaces (`onStart`, `onSuccess`, `onError`, `onSettled`) for server action lifecycle hooks along with a helper to combine multiple callbacks. This generic pattern is reusable in any async operation hook context and does not require the full ZSA core.