https://github.com/theedoran/next-safe-action
Type safe and validated Server Actions in your Next.js project.
https://github.com/theedoran/next-safe-action
actions app-dir mutations next next-actions nextjs react react-actions react-server-components rsc server-actions server-components typesafe typescript zod
Last synced: 25 days ago
JSON representation
Type safe and validated Server Actions in your Next.js project.
- Host: GitHub
- URL: https://github.com/theedoran/next-safe-action
- Owner: TheEdoRan
- License: mit
- Created: 2023-04-16T02:12:14.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-03T23:01:40.000Z (about 1 month ago)
- Last Synced: 2025-05-12T15:23:56.894Z (25 days ago)
- Topics: actions, app-dir, mutations, next, next-actions, nextjs, react, react-actions, react-server-components, rsc, server-actions, server-components, typesafe, typescript, zod
- Language: TypeScript
- Homepage: https://next-safe-action.dev
- Size: 29.3 MB
- Stars: 2,719
- Watchers: 6
- Forks: 41
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
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.
## 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](https://next-safe-action.dev).** ✨
### Looking for v6 docs?
You can keep using version 6 and eventually upgrade to version 7. Check out the v6 documentation [here](https://v6.next-safe-action.dev).
## Migrate from v6 to v7
Check out the [v6 to v7 migration guide](https://next-safe-action.dev/docs/migrations/v6-to-v7) to learn how to update your code for v7.
## Installation
```bash
npm i next-safe-action
```## Playground
You can find a basic working implementation of the library [here](https://github.com/TheEdoRan/next-safe-action/tree/main/apps/playground).
## Sponsors
A big shout-out to all our [sponsors](https://github.com/sponsors/TheEdoRan)! You’re the driving force behind this library's growth, and we're truly grateful for your support. ❤️
## Contributing
If you want to contribute to next-safe-action, please check out the [contributing guide](https://github.com/TheEdoRan/next-safe-action/blob/main/CONTRIBUTING.md).
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](https://github.com/TheEdoRan/next-safe-action/issues/new/choose).
## Contributors
Made with [contrib.rocks](https://contrib.rocks).
## License
next-safe-action is released under the [MIT License](https://github.com/TheEdoRan/next-safe-action/blob/main/LICENSE).