next-safe-action

Typesafe Server Actions in your Next.js 13 app.
GitHub
2.13k
Created a year ago, last commit 3 days ago
11 contributors
468 commits
Stars added on GitHub, month by month
10
11
12
1
2
3
4
5
6
7
8
9
2023
2024
Stars added on GitHub, per day, on average
Yesterday
+1
Last week
+2.1
/day
Last month
+3.4
/day
Last 12 months
+4.9
/day
Package on NPM
Monthly downloads on NPM
10
11
12
1
2
3
4
5
6
7
8
9
2023
2024
No dependencies
README

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.

How does it work?

Like magic. šŸŖ„

demo.mp4

Features

  • āœ… 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

Documentation

Explore the documentation for the current stable version of the library on the next-safe-action v7 website. āœØ

Looking for v6 docs?

You can keep using version 6 and eventually upgrade to version 7. Check out the v6 documentation here.

Migrate from v6 to v7

Check out the v6 to v7 migration guide to learn how to update your code for v7.

Installation

npm i next-safe-action

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 MIT License.