@scwar/nestjs-prembly-sdk
v1.2.0
Published
A comprehensive NestJS module for integrating with the Prembly API
Maintainers
Readme
@scwar/nestjs-prembly-sdk
A comprehensive NestJS module for integrating with the Prembly API. This package has a shared HTTP core, typed Nest module setup, grouped domain services, and country-specific data-verification services.
Features
- Broad Prembly API coverage across core verification, fraud, background-check, and country-specific endpoints
- NestJS-friendly
PremblyModule.forRoot()andforRootAsync()configuration - Shared HTTP client with retries, timeout handling, and typed error wrapping
- Top-level grouped services with nested
backgroundCheckanddataVerificationdomains - Generated country service files and specs from a harvested Prembly endpoint catalog
Installation
npm install @scwar/nestjs-prembly-sdkQuick Start
import { Module } from '@nestjs/common';
import { PremblyModule } from '@scwar/nestjs-prembly-sdk';
@Module({
imports: [
PremblyModule.forRoot({
apiKey: process.env.PREMBLY_API_KEY!,
}),
],
})
export class AppModule {}import { Injectable } from '@nestjs/common';
import { PremblyService } from '@scwar/nestjs-prembly-sdk';
@Injectable()
export class IdentityService {
constructor(private readonly prembly: PremblyService) {}
verifyBvn(number: string) {
return this.prembly.dataVerification.nigeria.bvnBasic({ number });
}
checkPep(name: string) {
return this.prembly.amlScreening.pepAndSanction({ name });
}
}Configuration
interface PremblyModuleOptions {
apiKey: string;
appId?: string;
baseUrl?: string;
timeout?: number;
retries?: number;
retryDelay?: number;
maxRetryDelay?: number;
}Service Layout
prembly.generalprembly.globalBusinessVerificationprembly.amlScreeningprembly.multipleCountriesCheckprembly.globalDocumentVerificationprembly.biometricsprembly.backgroundCheck.candidateprembly.backgroundCheck.packageprembly.backgroundCheck.configurationprembly.dataVerification.<country>prembly.transactionMonitoringprembly.fraudScan
Scripts
npm run generate:sdk
npm run build
npm testNotes
- The SDK always sends
x-api-key. It only sendsapp-idwhen you provideappIdin the module options. - The large country-specific verification surface is generated from a local endpoint catalog in
scripts/catalog-source.json. - Some Prembly reference pages expose inconsistent titles and path shapes; the generator preserves the harvested endpoints and normalizes method names for ergonomic Nest usage.
