Skip to content

TheEdoRan/next-safe-action

next-safe-action is a library that takes full advantage of the latest and greatest Next.js, React and TypeScript features, using validation libraries of your choice, to let you define type safe Server Actions and execute them inside React Components.

How does it work?

Like magic. 🪄

demo.mp4

Features

  • ✅ Pretty simple
  • ✅ End-to-end type safety
  • ✅ Powerful middleware system
  • ✅ Input validation using multiple validation libraries
  • ✅ Advanced server error handling
  • ✅ Optimistic updates

Documentation

Explore the documentation for the next version of the library on the next-safe-action website.

Installation

npm i next-safe-action@next

Playground

You can find a basic working implementation of the library here.

Contributing

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.

Contributors

Made with contrib.rocks.

License

next-safe-action is released under the BSD-3-Clause License.