Porichoy · NID Verification Gateway of Bangladesh ·
const porichoy = require('porichoy');
const person = {
nid: '1234567890',
dob: '2000-01-01',
name: 'Mehdi Hassan Jony',
};
const createAccount = async () => {
if (await porichoy.verify(person)) {
//Your code for creating account.
}
};
This package will make it very easy to use Porichoy API in your NodeJS project along with nestjs and express. It has some dependency like @nestjs/axios, @nestjs/config, moment, rxjs. This package is now ready to use in production. Although more new features are on the way. Feel free to provide feedback, I will highly appreciate it.
- Visit the official website of Porichoy API to get your API Key.
- For Porichoy API documentation visit this website.
- This npm package is still under mass development. This package is not managed by the officials of Porichoy API.
set env variable PORICHOY_BASE_URL = <api_url>
set env api PORICHOY_KEY = <api_key>
####The callback approach
export class DemoService{
constructor(
private nidService: NidVerificationService,
){}
const person = {nid: "1456782945", dob: "1999-11-29", name: "Asik Ahmed"};
const nidUserResponse: NIDVerificationResponse =
await this.nidService.verify(person);
if (!nidUserResponse)
throw new BadRequestException(
'Nid verification failed with the provider NID and DOB',
);
(async () => console.log((await this.nidService.verify(person))? 'Valid NID':'Invalid NID'))();
}