@tagadapay/zsa
v0.6.2-nextjs15
Published
Next.js 15 compatible version of ZSA - Build safe server actions
Downloads
9
Readme
@tagadapay/zsa
Next.js 15 Compatible Version of ZSA (Zod Server Actions)
This is a fork of the original ZSA library with full Next.js 15 compatibility.
🚀 What's New
✅ Next.js 15 Support - Fully compatible with Next.js 15.x
✅ Async Cookies - Updated for Next.js 15's async cookies() function
✅ React 19 Support - Compatible with React 19
✅ Updated NextRequest Interface - Removed deprecated geo and ip properties
✅ Type Safety - Maintains full TypeScript support
📦 Installation
npm install @tagadapay/zsa @tagadapay/zsa-react
# Optional: for React Query support
npm install @tagadapay/zsa-react-query
# Optional: for OpenAPI support
npm install @tagadapay/zsa-openapi🔄 Migration from Original ZSA
Simply replace your imports:
// Before
import { createServerAction } from "zsa"
import { useServerAction } from "zsa-react"
// After
import { createServerAction } from "@tagadapay/zsa"
import { useServerAction } from "@tagadapay/zsa-react"💡 Usage with Next.js 15
"use server"
import { createServerAction } from "@tagadapay/zsa"
import { cookies } from "next/headers"
import { z } from "zod"
export const getUserAction = createServerAction()
.input(z.object({ userId: z.string() }))
.handler(async ({ input }) => {
// ✅ Now works with Next.js 15
const cookieStore = await cookies()
const session = cookieStore.get("session")
// Your logic here
return { user: { id: input.userId } }
})🔗 Links
- Original ZSA: https://github.com/IdoPesok/zsa
- Documentation: https://zsa.vercel.app
- This Fork: https://github.com/stanislascuenat/zsa
⚠️ Note
This is a community fork to provide Next.js 15 compatibility. All credit goes to the original ZSA authors. Once the original library supports Next.js 15, consider migrating back.
📄 License
MIT - Same as original ZSA
