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.
Documentation
Explore the documentation for the current library version on next-safe-action website. ✨
Next.js >= 14 vs 13
Server Actions are now a stable feature in React. For this reason, there were some internal breaking changes to the API, and so a new version of the library is required to prevent backward compatibility issues.
You can continue to use next-safe-action
version 4 for your Next.js 13 app.
npm i next-safe-action
npm i next-safe-action@v4
Migration guide
Version 7.x.x of the library supports form actions and improves validation errors handling. Please check out the v6 to v7 migration guide on the website for more information.