On this page
Overview
next-safe-action is a library for defining and executing Next.js Server Actions with type safety and validation. It combines input and output validation, middleware, server error handling, form actions, and optimistic updates while preserving types across the client-to-server boundary.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Connect Server Action inputs and outputs through validation schemas and TypeScript types
Action definitions can validate inputs and preserve client/server types, with support for multiple validation libraries including Zod.
Sources: [1]
Centralize action lifecycle behavior with middleware, error handling, and React hooks
The middleware system, server-error handling, Form Actions, and optimistic-action hooks help centralize authentication, logging, validation errors, and UI lifecycle behavior.
Sources: [1]
Best fit
Before adoption
Target Next.js 14+ and React 18.2+ and retest integration across framework upgrades
Version 8.7.3 requires Node 18.17+, declares Next.js 14+ and React/React DOM 18.2+ as peer requirements, and depends on framework Server Action behavior, so Next.js upgrades should include integration tests.
Sources: [2]
Test client lifecycle callbacks such as redirect and navigation behavior across updates
Version 8.7.3 fixes duplicate onNavigation and onSettled callbacks around redirects in action hooks. Test navigation and optimistic-state behavior in addition to server-side success and error results.
Sources: [3]
Official sources
- [1]next-safe-action 8.7.3 README(2026-10-06)
- [2]next-safe-action 8.7.3 package metadata(2026-10-06)
- [3]next-safe-action 8.7.3 release(2026-10-06)
- [4]next-safe-action MIT license(2026-10-06)
Supplemental curator note
It fits App Router applications that use Server Actions as mutation boundaries. Review validation schemas, middleware responsibilities, framework versions, and redirect/navigation lifecycle behavior across upgrades.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/next-safe-action/next-safe-action.git - 2
Enter the repository
cd next-safe-action - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
3,076 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 4
- Open PRs
- 1
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- actions
- app-dir
- mutations
- next
- nextjs
- react
- rsc
- server-components
- typesafe
- typescript
- react-server-components
- react-actions
- Stars
- 3,076
- Forks
- 48
- Watchers
- 6
- Open issues
- 5
- Contributors
- 26
- Owner type
- Organization
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Sep 30, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- ts-rest3,338 Stars
4 shared tag(s) · 1 shared category(s) · Same language
share REST contracts for end-to-end type safety across clients, servers, and OpenAPI
TypeScript - Proxed.AI8 Stars
4 shared tag(s) · Same language
protect AI credentials for iOS apps behind a server-side proxy
TypeScript - SWR32,490 Stars
3 shared tag(s) · 1 shared category(s) · Same language
cache remote React data and manage revalidation, deduplication, and updates through hooks
TypeScript - Onlook26,858 Stars
3 shared tag(s) · 1 shared category(s) · Same language
a web-based design-to-code workspace for visually and AI-editing real Next.js/Tailwind source
TypeScript - Sentry JavaScript SDKs8,750 Stars
3 shared tag(s) · 1 shared category(s) · Same language
add observability across Next.js, Node.js, browsers, and other JavaScript runtimes
TypeScript - jose7,815 Stars
3 shared tag(s) · 1 shared category(s) · Same language
handle JWT, JWS, JWE, JWK, and JWKS with a zero-dependency Web-standard JOSE library
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.