
Concurrent unofficial API for accessing NIDA information. Enables non-blocking usage across multiple platforms with coroutine support, providing a testing setup using a fake API implementation.
Unofficial Concurrent Kotlin Multiplatform NIDA API
val api: NidaApi = NidaApiBrela()
api.info(nin = "19900101000000000001").then {
println(it.name) // John Makongoro Doe
println(it.dateOfBirth) // 1990-01-01
// . . .
println(it.nationality) // Tanzanian
}.catch {
println("Oops!, Error: ${it.message}")
}dependencies {
implementation("io.ktor:ktor-client-cio:[ktor-version]") // or any other ktor client engine
implementation("tz.co.asoft:kida-brela:2.0.17")
}To make it easy for ktor users to choose their own client engines We have provided an extra artifact kida-ktor where one would include the artifact and their favourite ktor-client engine
dependencies {
implementation("tz.co.asoft:kida-ktor:2.0.17")
implementation("io.ktor:ktor-client-android:[ktor-version]") // for android engine
implementation("io.ktor:ktor-client-cio:[ktor-version]") // for cio engine
}This api has been made in a non-blocking but still easily usable from other platforms i.e. Swift, Java and even Javascript/Typescript
It comes with a suspending method await that can be called in
suspend functions
val info = api.info(nin = "<nin-goes-here>").await() // << suspends on await
with(info) {
println(name) // John Makongoro Doe
println(dateOfBirth) // 1990-01-01
// . . .
println(nationality) // Tanzanian
}To make it easy to write tests for your logic, we have integrated a NidaApiFake implementation
val api: NidaApi = NidaApiFake()
api.info("19900101000000000001")Just add the kida-fake implementation on your tests
dependencies {
implementation("tz.co.asoft:kida-fake:2.0.17")
}You can use these two nin to test if you have everything wired up correctly
There are multiple ways you can support this project
If you found it useful, just give it a star
You can help by submitting pull request to available open tickets on the issues section
This makes it easier to catch bugs and offer enhancements required
Unofficial Concurrent Kotlin Multiplatform NIDA API
val api: NidaApi = NidaApiBrela()
api.info(nin = "19900101000000000001").then {
println(it.name) // John Makongoro Doe
println(it.dateOfBirth) // 1990-01-01
// . . .
println(it.nationality) // Tanzanian
}.catch {
println("Oops!, Error: ${it.message}")
}dependencies {
implementation("io.ktor:ktor-client-cio:[ktor-version]") // or any other ktor client engine
implementation("tz.co.asoft:kida-brela:2.0.17")
}To make it easy for ktor users to choose their own client engines We have provided an extra artifact kida-ktor where one would include the artifact and their favourite ktor-client engine
dependencies {
implementation("tz.co.asoft:kida-ktor:2.0.17")
implementation("io.ktor:ktor-client-android:[ktor-version]") // for android engine
implementation("io.ktor:ktor-client-cio:[ktor-version]") // for cio engine
}This api has been made in a non-blocking but still easily usable from other platforms i.e. Swift, Java and even Javascript/Typescript
It comes with a suspending method await that can be called in
suspend functions
val info = api.info(nin = "<nin-goes-here>").await() // << suspends on await
with(info) {
println(name) // John Makongoro Doe
println(dateOfBirth) // 1990-01-01
// . . .
println(nationality) // Tanzanian
}To make it easy to write tests for your logic, we have integrated a NidaApiFake implementation
val api: NidaApi = NidaApiFake()
api.info("19900101000000000001")Just add the kida-fake implementation on your tests
dependencies {
implementation("tz.co.asoft:kida-fake:2.0.17")
}You can use these two nin to test if you have everything wired up correctly
There are multiple ways you can support this project
If you found it useful, just give it a star
You can help by submitting pull request to available open tickets on the issues section
This makes it easier to catch bugs and offer enhancements required