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.