Type-Safe API Development for Next.js

Boost your developer experience with seamless type consistency, automatic Swagger documentation, and protocol buffer support.

Powered by Zod Schemas

Schema Driven Development

Use zod to describe the input and output schemas into your application, so you can easyly centralize all the information your API is receiving and returning to the consumers.

  • checkZod Schemas Support.
  • check Easy integration with protocol buffers once schemas are defined.
  • checkAutomatic validation of the data consistency.
Learn More About Zod bluebutton

Initio server utils

Create API definitions

Describe your API endpoints, so the API utils can infer the types for both server functions as well as client consumers.

  • checkDescribe the method of your endpoint
  • checkDefine the right schemas for the endpoint
  • checkIf required specify the corresponding proto files
Learn More About Zod-To-OpenAPI Library

Next Server Functions

Use Initio Helper Function to Create Server Functions

Every API definition will have a 'setHandler' function that can be used to define the corresponding serv function. This helper will expose the right types to the function passed as argument.

Learn More About Next APP RouterpinkButton

Straight Forward Consumer

Create a React Query based Consumer

Once you have defined your API endpoint, you can easyly create a consumer, which will have the infered types and will help you to see the right data for each endpoint. (Mutators will come in future releases)

Learn More About React Querygreenbutton

OpenAPI Out of the Box

Create your API documentation automatically (currently only in vercel)

To achieve this you need to configure your application in vercel as follow:

Build command:

pnpm run next-base:build:prod

Output directory

dist/apps/next-base/.next

Install command

pnpm install --frozen-lockfile

This will create the OpenAPI JSON automatically (as shown in the code block) and the documentation can be accessed either from /api/docs in JSON format or using the SwaggerUI accessing to /docs

© Copyright 2024. Your Site. All rights reserved.

xFbFeed