@khaleejiapi/nestjs
v1.0.1
Published
Official NestJS module for KhaleejiAPI with keep-alive pooling, 429 retry handling, and bilingual exception support
Maintainers
Readme
@khaleejiapi/nestjs
Official NestJS module for KhaleejiAPI with connection pooling, 429 retry handling, bilingual exception payload preservation, and ready-to-use DTOs for regional validation flows.
Installation
npm install @khaleejiapi/nestjs @nestjs/axios class-transformer class-validatorQuick start
import { Module } from '@nestjs/common';
import { APP_FILTER } from '@nestjs/core';
import {
KhaleejiApiExceptionFilter,
KhaleejiApiModule,
} from '@khaleejiapi/nestjs';
@Module({
imports: [
KhaleejiApiModule.registerAsync({
useFactory: async () => ({
apiKey: process.env.KHALEEJI_API_KEY!,
timeout: 10_000,
maxRateLimitRetries: 3,
}),
}),
],
providers: [
{
provide: APP_FILTER,
useClass: KhaleejiApiExceptionFilter,
},
],
})
export class AppModule {}Built-in DTOs
EmiratesIdDtoSaudiIdDtoGccPhoneDto
All DTOs use class-validator decorators and normalize common spacing / punctuation via class-transformer.
