Skip to main content
Apinni LogoApinni Logo

TypeScript Types
Generated Automatically

Apinni generates clean .d.ts files with API schemas and utilities from your backend decorators. Zero runtime overhead, no bundle exposure, with plugin support and proxy API capabilities.

🚀Just Launched
TypeScript 5.0+ support
Zero runtime overhead

Quick Start

Get up and running with Apinni in just 4 simple steps.

1

Install

Install apinni with favourite package manager

2

Configure

Enable decorators in tsconfig.json

3

Decorate

Add @Apinni decorators to your classes and methods

4

Generate

Run apinni CLI command

Pure Type Generation Philosophy

Generate clean .d.ts files without runtime logic or bundle exposure.

Pure Type Generation

Generate only types files with API schemas from @Apinni decorators.

No Bundle Exposure

Types stay in .d.ts files, never bundled. Prevents API endpoint leaks in client builds.

Proxy API Support

Utilities to define ProxyApi schemas for proxy layers like Next.js.

Plugin Architecture

Extensible plugin system to customize type generation and add framework-specific utilities.

From Decorators to Types

Decorate your backend, get clean type definitions. No runtime code, no bundle bloat.

Backend Controller with Decorators
import { ApinniController, ApinniEndpoint } from '@apinni/client-ts';

type CreateUserDto = {
name: string;
email: string;
}

@ApinniController({ path: '/api/users' })
export class UserController {
@ApinniEndpoint({ path: '/:id', method: 'GET' })
async getUserById() {
// your framework specific param resolver
return { id: '1', name: 'John', email: 'john@mail.com' };
}

@ApinniEndpoint<{
request: {
type: CreateUserDto
}
}>({ path: '/', method: 'POST' })
async createUser(userData: CreateUserDto) {
return {
id: '1',
...userData,
createdAt: new Date().toISOString()
};
}
}
Generated types.d.ts File
// Auto-generated by Apinni - Never bundled
export type GetApiUsersByIdResponse = {
id: string;
name: string;
email: string;
};

export type CreateUserDto = {
name: string;
email: string;
}

export type PostApiUsersRequest = CreateUserDto

export type PostApiUsersResponse = {
id: string;
name: string;
email: string;
createdAt: string;
};

// API Schema - No runtime code
export type Api = BuildApi<{
['/api/users/:id']: {
GET: {
query: never;
request: never;
responses: {
200: GetApiUsersByIdResponse;
};
};
};
['/api/users']: {
POST: {
query: never;
request: PostApiUsersRequest;
responses: {
200: PostApiUsersResponse;
};
};
};
}>;

// Utilities goes here

Ready to Get Started?

Terminal
$ npm install @apinni/client-ts --save-dev
$ npm run apinni

Enable decorators in your tsconfig.json and run Apinni to generate clean .d.ts files from your decorated controllers.