next-safe-action is a library that takes full advantage of the latest and greatest Next.js, React and TypeScript features to let you define type safe Server Actions and execute them inside React Components.
Like magic. 🪄
demo.mp4
- ✅ Pretty simple
- ✅ End-to-end type safety
- ✅ Form Actions support
- ✅ Powerful middleware system
- ✅ Input/output validation using multiple validation libraries
- ✅ Advanced server error handling
- ✅ Optimistic updates
Explore the documentation for the current stable version of the library on the next-safe-action v7 website. ✨
You can keep using version 6 and eventually upgrade to version 7. Check out the v6 documentation here.
Check out the v6 to v7 migration guide to learn how to update your code for v7.
npm i next-safe-action
You can find a basic working implementation of the library here.
A big shout-out to all our sponsors! You’re the driving force behind this library's growth, and we're truly grateful for your support. ❤️
Arcjet |
If you want to contribute to next-safe-action, please check out the contributing guide.
If you found bugs or just want to ask a question, feel free to open an issue or a discussion by following the issue templates.
Made with contrib.rocks.
next-safe-action is released under the MIT License.