next-api-utils
v3.0.1
Published
Utilities for building maintainable backend APIs for the Next.js app router.
Readme
next-api-utils
Utilities for building better APIs with Next.js app router.
Installation
npm i next-api-utilsNext.js version compatibility
| Next.js version | Zod version | next-api-utils version | | --------------- | ----------- | ------------------------- | | v15 | v4 | v3 | | v15 | v3 | v2 | | v14 | v3 | v1 (no longer maintained) | | v13 | v3 | v1 (no longer maintained) |
Documentation
Generated documentation for the latest version is available at next-api-utils.jonahsnider.dev.
Usage
Client components
If you try importing next-api-utils from a client component, you will get an error since certain features are only available on the server.
There is a separate export you can use in client components, which doesn't include any of the server-only features.
import { ... } from 'next-api-utils/client';The default export and next-api-utils/server extend next-api-utils/client with server-only features.
