Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/IdoPesok/zsa
https://github.com/IdoPesok/zsa
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/IdoPesok/zsa
- Owner: IdoPesok
- License: mit
- Created: 2024-05-01T01:32:09.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-14T18:09:49.000Z (4 months ago)
- Last Synced: 2024-07-14T19:49:40.368Z (4 months ago)
- Language: TypeScript
- Homepage: https://zsa.vercel.app
- Size: 1.99 MB
- Stars: 468
- Watchers: 4
- Forks: 15
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-typesafe - IdoPesok/zsa - Typesafe Server Actions for Next.js. (**1. Libraries** / Web)
README
# 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:
```bash
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](https://zsa.vercel.app/docs/introduction).
## Support
If you need help with anything, feel free to DM ([@ido_pesok](https://twitter.com/ido_pesok)) on X.
## Disclaimer
This is a personal project and is not associated with any company or organization. While I strive to make this project as reliable and useful as possible, it is provided "as is" without any guarantees or warranties.
**Use at your own risk.** You are responsible for reviewing, testing, and validating the code to ensure it meets your requirements and for any consequences that may arise from its use.
I will do my best to maintain and improve this project, but please understand that as a personal project, support and updates may be limited.
## [Contributors](https://github.com/IdoPesok/zsa/graphs/contributors)