其他

safe-action-advanced

next-safe-action/skills

Use when working with bind arguments, metadata schemas, framework errors (redirect/notFound/forbidden/unauthorized), type inference utilities (InferSafeActionFnInput/Result), or server-level action callbacks

  • 1215 次安装
  • 1 星标
  • 收录于

安装命令

npx skills add https://github.com/next-safe-action/skills --skill safe-action-advanced

SKILL.md

next-safe-action Advanced Features

Overview

Feature Use Case
Bind arguments Pass extra args to actions via .bind() (e.g., resource IDs)
Metadata Attach typed metadata to actions for use in middleware
Framework errors Handle redirect, notFound, forbidden, unauthorized in actions
Type utilities Infer types from action functions and middleware

Server-Level Action Callbacks

The second argument to .action() accepts callbacks that run on the server (not client-side hooks):