pkenya
v1.0.0
Published
TypeScript SDK for Kenyan professional & identity data API
Maintainers
Readme
🇰🇪 PKenya SDK
Overview
A TypeScript SDK for verifying Kenyan professional and identity data via the PKenya API.
It allows developers to easily integrate trusted verification services for:
- Professional licenses
- Registration status
- Facility records (coming soon)
- Identity verification (coming soon)
Features
- Secure API key authentication
- Simple, developer-friendly API
- Fully typed (TypeScript support)
- Modular architecture (profession, identity, facility)
- Works in Node.js environments
- Lightweight and fast
Installation
npm:
npm install pkenyapnpm:
pnpm add pkenyayarn:
yarn add pkenyaAPI Key
To use this SDK, you must generate an API key.
Setup
Option 1: Direct
import { PKenyaClient } from "pkenya";
const client = new PKenyaClient({
apiKey: "pk_live_your_api_key",
});Option 2: Environment Variables
PKENYA_API_KEY=pk_live_your_api_key
PKENYA_BASE_URL=https://api.pkenya.comimport "dotenv/config";
import { PKenyaClient } from "pkenya";
const client = new PKenyaClient();Usage
The PKenya SDK is fully TypeScript-powered and provides a clean, modular, dot-notation API for accessing verification services.
// Pharmacist verification example
const license = await client.profession.pharmacist({
registration_number: "2378",
license_number: "P2026D00592",
});
console.log(license);API Structure
Profession Verification
client.profession.doctor(...)
client.profession.engineer(...)
client.profession.advocate(...)
client.profession.accountant(...)
client.profession.pharmacist(...)
client.profession.pharmacyTechnician(...)
client.profession.clinicalOfficer(...)Coming Soon
client.identity.verify()
client.facility.lookup()Error Handling
The SDK may throw errors for:
- Missing API key
- Invalid configuration
- API request failures
- Not found (404) responses
- Unauthorized access (401)
Example:
try {
await client.profession.doctor({
license_no: "12345",
});
} catch (error) {
console.log(error.status);
console.log(error.message);
console.log(error.data);
}Design Philosophy
- Explicit over implicit
- Strong TypeScript safety
- Modular architecture
- Enterprise-ready SDK design
Security
- API keys are never logged
- Secure request headers only
- No environment mutation
- Safe-by-default configuration
Roadmap
- Identity verification module
- Facility lookup system
- Retry + exponential backoff system
- Webhooks support
- Request logging hooks
- Rate limiting handling
Documentation
Full SDK documentation, examples, and API reference:
Get API Key
Create and manage your API keys here:
License
MIT © PKenya
