TypeScript SDK for Receipt Verification
Free TypeScript SDK for verifying Ethiopian bank receipts.
View SDK on GitHubSDK overview
The cheki TypeScript SDK is a lightweight wrapper around the REST API. It provides typed methods for single verification, batch verification, bank listing, and health checking. The SDK is zero-dependency (uses native fetch) and works in both Node.js and browser environments.
Quick start
Import the ChekiAPI class, create an instance with the base URL, and call verify with the bank code, reference, and optional account number. The SDK returns a typed response with all receipt fields. Error handling is done with try/catch.
Available methods
The SDK exposes four methods matching the REST API endpoints:
- verify(bank, reference, accountNumber?): verify a single receipt
- verifyUrl(url): verify by receipt URL (auto-detects bank)
- verifyBatch(receipts): verify up to 50 receipts in parallel
- listBanks(): get all supported banks with metadata
- healthCheck(): check endpoint status and latency
Frequently asked questions
How do I install the cheki TypeScript SDK?
The SDK is included in the cheki monorepo on GitHub. Clone the repo and import the SDK from the /sdk/typescript directory. Alternatively, you can copy the single-file SDK into your project. No npm install needed; it's a lightweight fetch wrapper.
Can I use the SDK in the browser?
Yes. The SDK uses the fetch API and works in both Node.js and the browser. However, browser-based calls to cheki's API are subject to CORS. For production use, we recommend calling the API from your backend.
Does the SDK handle errors?
Yes. The SDK throws typed errors for common scenarios: receipt not found, geo-blocked endpoint, invalid reference format, and network errors. Each error has a code and message that you can use for user-facing error handling.
View SDK on GitHub
Open cheki