Overview of zsa features
mainzsa is a library designed for building typesafe server actions in Next.js. It provides several key capabilities for managing server-side logic and client-side consumption:
- Type Safety: Full TypeScript support for inputs and outputs.
- Validation: Uses Zod schemas to validate both inputs and outputs.
- Procedures: Middleware-like functionality to add context (e.g., authentication) and authorization to server actions.
- Lifecycle Callbacks: Ability to run logic based on the server action lifecycle.
- Client Integration: Built-in loading states, error handling, and seamless React Query integration for querying actions in client components.
- Input Support: Native support for
FormDataas an input type. - Resilience: Includes retry functionality and timeouts for server actions.