Type safe Server Actions in your Next.js (App Router) project
next-safe-action handles your Next.js app mutations type safety, input validation, server errors and even more!
Why choose next-safe-action?
Pretty simple
No need to overcomplicate things. next-safe-action API is pretty simple, designed with fast development in mind.
End-to-end type safety
With next-safe-action you get full type safety between server and client code.
Form Actions support
next-safe-action supports Form Actions out of the box, with stateful and stateless actions.
Powerful middleware system
Manage authorization, log and halt execution, and much more with a composable middleware system.
Input validation using multiple validation libraries
Input passed from the client to the server is validated using Zod, Valibot or Yup.
Advanced server error handling
Decide how to return execution errors to the client and how to log them on the server.
Optimistic updates
Need to update UI immediately without waiting for server response? You can do it with the powerful
useOptimisticAction
hook.Coolest web devs say:
Dmitry@dihmeetree
Thank you @TheEdoRan for the "next-safe-action" package! It's super awesome!! Keep up the amazing work! 😊
Dec 12, 2023
Kingsley O.@Kingsley_codes
If you aren't using next-safe-actions by @TheEdoRan for your Next 14 app, what are you waiting for? The DX is marvelous. An even better package than zact and @t3dotgg recommends it too so you know it's good!
Oct 28, 2023
zaphodias@zaphodias
step 1: upgrade to next 13.4;
step 2: understand actions;
step 3: use @TheEdoRan's lib 🎉
step 2: understand actions;
step 3: use @TheEdoRan's lib 🎉
May 4, 2023
rigo@rclmenezes
I predict that https://github.com/TheEdoRan/next-safe-action is going to get a loooooot of stars in a few hours :)
Props @TheEdoRan
Props @TheEdoRan
May 4, 2023
Erfan Ebrahimnia@ErfanEbrahimnia
Using next-safe-action by @TheEdoRan in a project right now and really like it
It handles input-validation and errors when using Server Actions
https://github.com/TheEdoRan/next-safe-action
It handles input-validation and errors when using Server Actions
https://github.com/TheEdoRan/next-safe-action
Sep 7, 2023
Xexr@Xexr
@t3dotgg I saw you mention next-safe-action on your live stream. I wanted to throw my hat in the ring and give it a shout out.
It's honestly great, @TheEdoRan has done a fantastic job and it deserves way more attention, I suspect it will get it after the stream mention. 👇
It's honestly great, @TheEdoRan has done a fantastic job and it deserves way more attention, I suspect it will get it after the stream mention. 👇
Jun 28, 2023
It's time to try it out for yourself!