MCPcopy
hub / github.com/next-safe-action/next-safe-action

github.com/next-safe-action/next-safe-action @v8.1.5 sqlite

repository ↗ · DeepWiki ↗ · release v8.1.5 ↗
175 symbols 521 edges 106 files 9 documented · 5%
README

next-safe-action logo

next-safe-action

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 v8 website.

Looking for v7 docs?

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

Migrate from v7 to v8

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

Installation

npm i next-safe-action

Playground

You can find a basic working implementation of the library here.

Sponsors

A big shout-out to all our sponsors! You’re the driving force behind this library's growth, and we're truly grateful for your support. ❤️

☕ Supporters

Pontus Abrahamsson Pontus Abrahamsson

👷 Past sponsors

Vercel Vercel ArcJet ArcJet Liam Murray Liam Murray David Chalifoux David Chalifoux Rein Undheim Rein Undheim Merthan Merter Merthan Merter Marco Moroni Marco Moroni Gustavo Felisberto Gustavo Felisberto Robin Wieruch Robin Wieruch

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.

Extension points exported contracts — how you extend this code

StandardSchemaV1 (Interface)
(no doc)
packages/next-safe-action/src/standard-schema.ts
Props (Interface)
(no doc)
packages/next-safe-action/src/standard-schema.ts
SuccessResult (Interface)
(no doc)
packages/next-safe-action/src/standard-schema.ts
FailureResult (Interface)
(no doc)
packages/next-safe-action/src/standard-schema.ts
Issue (Interface)
(no doc)
packages/next-safe-action/src/standard-schema.ts

Core symbols most depended-on inside this repo

action
called by 109
packages/next-safe-action/src/safe-action-client.ts
inputSchema
called by 72
packages/next-safe-action/src/safe-action-client.ts
use
called by 33
packages/next-safe-action/src/safe-action-client.ts
isNavigationError
called by 25
packages/next-safe-action/src/next/errors/index.ts
createSafeActionClient
called by 20
packages/next-safe-action/src/index.ts
metadata
called by 19
packages/next-safe-action/src/safe-action-client.ts
bindArgsSchemas
called by 18
packages/next-safe-action/src/safe-action-client.ts
returnValidationErrors
called by 12
packages/next-safe-action/src/validation-errors.ts

Shape

Function 121
Class 24
Method 21
Interface 7
Enum 2

Languages

TypeScript100%

Modules by API surface

packages/next-safe-action/src/validation-errors.ts21 symbols
packages/next-safe-action/src/safe-action-client.ts10 symbols
packages/next-safe-action/src/standard-schema.ts9 symbols
packages/next-safe-action/src/next/errors/dynamic-usage.ts7 symbols
packages/next-safe-action/src/next/errors/index.ts6 symbols
apps/playground/src/app/(examples)/state-update/page.tsx6 symbols
apps/playground/src/app/(examples)/revalidation-callbacks/revalidation-callbacks-client.tsx6 symbols
apps/playground/src/app/(examples)/optimistic-hook/addtodo-form.tsx6 symbols
apps/playground/src/app/(examples)/navigation/page.tsx6 symbols
apps/playground/src/app/(examples)/hook/page.tsx6 symbols
packages/next-safe-action/src/hooks-utils.ts5 symbols
packages/next-safe-action/src/next/errors/bailout-to-csr.ts4 symbols

Dependencies from manifests, versioned

@commitlint/cli19.7.1 · 1×
@commitlint/config-conventional19.7.1 · 1×
@docusaurus/core3.8.0 · 1×
@docusaurus/module-type-aliases3.8.0 · 1×
@docusaurus/preset-classic3.8.0 · 1×
@docusaurus/remark-plugin-npm2yarn3.8.0 · 1×
@docusaurus/tsconfig3.8.0 · 1×
@docusaurus/types3.8.0 · 1×
@eslint/js9.19.0 · 1×
@hookform/resolvers4.1.3 · 1×
@manypkg/cli0.23.0 · 1×
@mdx-js/react3.1.0 · 1×

For agents

$ claude mcp add next-safe-action \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact