A comprehensive and intuitive package for Kenyan administrative divisions (counties, constituencies, and wards) and Locations + Areas
# Kenya Locations
Kenyan administrative divisions — counties, sub-counties, constituencies, wards, localities, and areas — packaged as a fast, well-typed library for JavaScript/TypeScript, React, Kotlin/JVM, and Swift.
**47** counties · **307** sub-counties · **290** constituencies · **1,448** wards · **916** localities · **1,829** areas
---
## Packages
| Platform | Package | Install |
|---|---|---|
| **JavaScript / TypeScript** | `kenya-locations` | `npm install kenya-locations` |
| **React** | `kenya-locations-react` | `npm install kenya-locations-react` |
| **Kotlin / JVM** (Android, Spring Boot, etc.) | `io.github.davidamunga:kenya-locations` | See below |
| **Swift** (iOS, macOS, tvOS, watchOS) | `KenyaLocations` | See below |
All packages are built from the same JSON source data and share identical version numbers (except `kenya-locations-react`, which versions independently).
---
## Installation
### JavaScript / TypeScript
```bash
npm install kenya-locations
# pnpm add kenya-locations
# yarn add kenya-locations
```
### React
```bash
npm install kenya-locations-react
# peer deps: react >=18, kenya-locations
```
### Kotlin / JVM
```kotlin
// build.gradle.kts
dependencies {
implementation("io.github.davidamunga:kenya-locations:0.5.4")
}
```
Works on Android, Spring Boot, Ktor, CLI tools, and any JVM project. No Android SDK or special initialisation required — data loads lazily from the JAR classpath on first access.
### Swift (iOS, macOS, tvOS, watchOS)
In Xcode: **File → Add Package Dependencies** and enter `
github.com`, or add to `Package.swift`:
```swift
dependencies: [
.package(url: "
github.com", from: "0.5.0"),
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "KenyaLocations", package: "kenya-locations"),
]
),
]
```
Requires Swift 5.9+ / iOS 13+ / macOS 10.15+. Data loads lazily from the app bundle on first access.
---
## Quick Start …