Kotlin Multiplatform example application demonstrating every major feature of the
mondonode-connector-sdk
across four platforms: Android, Desktop (JVM), iOS, and browser (WasmJS).
| Screen | What you learn |
|---|---|
| Connect | Build a ConnectorConfig (host, port, TLS fingerprint, client label) and call MondoNodeConnector.create() |
| Authentication | The 3-step EC challenge-response flow — authenticate() → device approval → completeAuthentication() |
| Pending | Polling loop that retries completeAuthentication() every 5 s while the user approves on the device |
| API Console | Call every ApiEndpoint (GET/PUT monitors, plugins, transformers, results, pipeline, storages, …) and inspect the raw JSON response |
| Live Events | Open a WebSocket via connectEvents(), manage subscriptions with SET_SUBSCRIPTIONS, and watch real-time event frames scroll in |
The full authentication flow in ConnectViewModel is intentionally minimal (≈80 lines) so you can copy it directly into your own app.
| Platform | Minimum |
|---|---|
| Android | minSdk 26 (Android 8.0 Oreo) |
| Desktop JVM | JVM 17 |
| iOS | iOS 14+ |
| WasmJS | Modern browser with WebCrypto support |
Kotlin 2.0+, Gradle 8.x.
Clone the repo, then follow the steps for your target platform.
./gradlew :composeApp:assembleDebugInstall to a connected device or running emulator:
./gradlew :composeApp:installDebug./gradlew :composeApp:runRequires a Mac with Xcode 15+.
- Open
iosApp/iosApp.xcodeprojin Xcode. - Select an iPhone simulator or a connected device.
- Press Run (⌘R).
No local Mac? See ios-build-services.md for GitHub Actions, Codemagic, and other remote build options.
./gradlew :composeApp:wasmJsBrowserDevelopmentRunThe task starts a local dev server and prints the URL. Open it in any modern browser. On the first connection to a self-signed MondoNode device you will need to accept the certificate exception in the browser — the WasmJS platform delegates TLS to the browser rather than performing its own fingerprint check.
composeApp/
src/
commonMain/ Shared Compose UI and ViewModels
ui/
ConnectScreen.kt Connection form
PendingScreen.kt Waiting-for-approval screen
MainScreen.kt Tabbed container (API Console + Live Events)
ApiConsoleScreen.kt
EventsScreen.kt
AboutDialog.kt
viewmodel/
ConnectViewModel.kt Auth flow and connector lifecycle
ApiConsoleViewModel.kt
EventsViewModel.kt
App.kt Root composable; routes authState to screens
androidMain/ Android entry point (MainActivity)
desktopMain/ Desktop entry point (main.kt)
iosMain/ iOS entry point (MainViewController)
wasmJsMain/ Browser entry point (main.kt)
iosApp/ Xcode project wrapper for iOS
During local development the SDK is resolved from the sibling ../mondonode-connector-sdk
directory via a Gradle composite build:
// settings.gradle.kts
includeBuild("../mondonode-connector-sdk")To use the published Maven Central release instead, remove that line and add a version:
// composeApp/build.gradle.kts — commonMain
implementation("com.systemhalted.mondonode:mondonode-connector-sdk:<version>")Check Maven Central for the latest release.
The SHA-256 fingerprint of the Connector plugin's self-signed certificate is displayed on the
plugin's settings screen on the MondoNode device — either as text or as a QR code. Enter it
in the TLS Certificate Fingerprint field in the app. Format: colon-separated uppercase hex,
e.g. AA:BB:CC:DD:….
MIT — see LICENSE.
© 2025 SystemHalted