Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kubo-47e69177.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Introduction

ZapAction is a typed contract layer for Next.js Server Actions and TanStack Query.

What you get

  • Runtime validation for input and output with Zod.
  • Shared cache invalidation model between server and client.
  • Query key and cache tag helpers for predictable data flows.
  • React hooks that keep loading, success, and error states explicit.

Mental model

  1. defineAction is the source of truth for action contracts.
  2. setActionContext injects request context on the server.
  3. useActionQuery is for reads and enforces readPolicy: "read-only".
  4. useActionMutation is for writes and tag-based invalidation.

Suggested path

  1. Start with Project Setup.
  2. Continue with React Query.
  3. Validate behavior in Testing Patterns.
  4. Reuse the Full CRUD Example.