NestJS API Standards
CommunityConsistent NestJS API responses and pagination.
Authorahiendz
Version1.0.0
Installs0
System Documentation
What problem does it solve?
NestJS projects often diverge in how API responses, pagination, and errors are formatted, leading to inconsistent client experiences and more boilerplate. This Skill provides a standardized approach to wrap responses, implement pagination, and structure errors across NestJS APIs.
Core Features & Use Cases
- Generic response wrapper using a TransformInterceptor to unify successful responses into a standard shape: { statusCode, data, meta }.
- Pagination support with strict DTOs (PageOptionsDto, PageDto) and a Swagger-friendly ApiPaginatedResponse decorator for consistent list endpoints.
- Standardized error object (ApiErrorResponse) with statusCode, message, error, timestamp, and path, plus guidance for global or per-controller usage.
- Use Cases: admin dashboards, product catalogs, user listings, and any resource collection endpoints where consistent pagination and error handling improve UX and ease of integration.
Quick Start
Configure NestJS to apply the TransformInterceptor, adopt PageOptionsDto and PageDto for paginated results, and use ApiErrorResponse for standardized errors in your list endpoints.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: NestJS API Standards Download link: https://github.com/ahiendz/DuAnCuoiKhoa/archive/main.zip#nestjs-api-standards Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.