whatif-dev / nextjs-type-actions-zsa

Home Page:https://zsa.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zsa

zsa is a library for building typesafe server actions in Next.js. It provides a simple, scalable developer experience with features like validated inputs/outputs, procedures (middleware) for passing context to server actions, and React Query integration for querying server actions in client components.

Installation

Install zsa using your preferred package manager:

npm i zsa zsa-react zsa-react-query zsa-openapi zod

Features

  • Validated inputs and outputs using Zod schemas
  • Procedures for adding context and authorization to server actions
  • Callbacks for running additional logic based on server action lifecycle
  • Built-in loading states and error handling
  • React Query integration for querying server actions on the client side
  • Support for FormData as input type
  • Retry functionality and timeouts for server actions
  • TypeScript support for a fully typesafe experience

Documentation

View the full documentation and examples on zsa.vercel.app.

Support

If you need help with anything, feel free to DM (@ido_pesok) on X.

About

https://zsa.vercel.app

License:MIT License


Languages

Language:TypeScript 97.9%Language:JavaScript 1.7%Language:CSS 0.4%