npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

fayda-auth-client

v1.0.4

Published

JavaScript/TypeScript SDK for Fayda IDA (Identity Authentication) services. Provides a simple and intuitive interface for OTP generation, Yes/No authentication, and eKYC (Electronic Know Your Customer) operations. Features: - OTP Management: Request and v

Downloads

399

Readme

Fayda Auth Client - JavaScript/TypeScript

JavaScript/TypeScript SDK for Fayda IDA (Identity Authentication) services. Provides a simple and intuitive interface for OTP generation, Yes/No authentication, and eKYC (Electronic Know Your Customer) operations. Features: - OTP Management: Request and validate OTPs for Fayda ID verification - Yes/No Authentication: Perform authentication using OTP challenges - eKYC Services: Retrieve verified identity details securely - Cryptographic Security: Supports RSA-OAEP encryption, AES-GCM decryption, and JWT signing/verification - PKCS12 Key Support: Secure key and certificate management using PKCS12 keystores - Flexible Configuration: Supports environment variables and programmatic configuration - Robust Reliability: Comprehensive error handling, logging, and response validation Designed for seamless integration with Node.js and TypeScript applications interacting with Fayda IDA services.

Features

  • Framework Agnostic - Works with any Node.js application
  • TypeScript Support - Full TypeScript definitions included
  • Easy Integration - Simple factory pattern for instantiation
  • Complete API Support - OTP, Authentication, and eKYC endpoints
  • Cryptographic Security - RSA-OAEP encryption, AES-GCM decryption, and JWT signing
  • PKCS12 Key Support - Secure key and certificate management

Installation

npm install fayda-auth-client

Configuration

Create a configuration object with the following required properties:

const config = {
  // Base Configuration
  'fayda.base.url': 'https://base_url.fayda.et',
  'fayda.partner.id': 'your-partner-id',
  'fayda.env': 'Staging',
  
  // Authentication Credentials
  'clientId': 'your-client-id',
  'secretKey': 'your-secret-key',
  'appId': 'your_app_id',
  
  // Partner Credentials
  'partnerId': 'your-partner-id',
  'partnerApiKey': 'your-api-key',
  'mispLicenseKey': 'your-license-key',
  'ida.reference.id': 'PARTNER',
  
  // Certificate Paths
  'p12.path': './keys',
  'p12.password': 'your-password',
  
  // SSL Configuration
  'ida.ssl.verify': 'false',
  
  // URLs (auto-constructed from base URL)
  'ida.otp.url': '${fayda.base.url}/idauthentication/v1/otp/${mispLicenseKey}/${partnerId}/${partnerApiKey}',
  'ida.auth.url': '${fayda.base.url}/idauthentication/v1/auth/${mispLicenseKey}/${partnerId}/${partnerApiKey}',
  'ida.ekyc.url': '${fayda.base.url}/idauthentication/v1/kyc/${mispLicenseKey}/${partnerId}/${partnerApiKey}',
  'ida.certificate.url': '${fayda.base.url}/idauthentication/v1/internal/getCertificate',
  'ida.authmanager.url': '${fayda.base.url}/v1/authmanager/authenticate/clientidsecretkey'
};

Quick Start

import { IdaClientFactory, OtpRequestDTO, AuthRequestDTO } from 'fayda-auth-client';

// Create client
const client = IdaClientFactory.createClient(config);


const otpRequest: OtpRequestDTO = {
  individualId: '1234567890123456',
  individualIdType: 'FAN', 
  requestTime: new Date().toISOString(),
  otpChannel: ['EMAIL', 'PHONE']
};

const otpResponse = await client.requestOtp(otpRequest);

// Authenticate
const authRequest: AuthRequestDTO = {
  id: 'fayda.identity.auth',
  version: '1.0',
  transactionID: '1234567890',
  requestTime: new Date().toISOString(),
  consentObtained: true,
  individualId: '1234567890123456',
  individualIdType: 'FAN',
  otp: '123456',
  requestedAuth: {
    otp: true
  }
};

const authResponse = await client.authenticate(authRequest);

// Perform eKYC
const ekycRequest: AuthRequestDTO = {
  id: 'fayda.identity.auth',
  version: '1.0',
  transactionID: '1234567890',
  requestTime: new Date().toISOString(),
  consentObtained: true,
  individualId: '1234567890123456',
  individualIdType: 'FAN', 
  otp: '123456',
  requestedAuth: {
    otp: true,
    demo: true
  }
};

const ekycResponse = await client.performEkyc(ekycRequest);

Building

npm install
npm run build

Publishing to npm

npm login
npm publish --access public

License

Apache License 2.0