Network Monitor

A comprehensive in-app network inspection library for Kotlin Multiplatform & Android. Think "Chucker" for KMP.

v0.0.17 Kotlin Multiplatform Android
Maven Central Platform License

🚀 Ready to monitor your network?

Add Network Monitor to your project in under 2 minutes

📦 Installation

Add the definitions to your libs.versions.toml or build.gradle. Use the no-op artifact for release builds to ensure zero overhead in production.

# libs.versions.toml
networkMonitor = "0.0.17"

# Debug Implementation (Active Monitor)
networkMonitor-debug = { module = "com.kturker:networkmonitor", version.ref = "networkMonitor" }

# Release Implementation (No-Op / Safe)
networkMonitor-release = { module = "com.kturker:networkmonitor-noop", version.ref = "networkMonitor" }
💡 Pro Tip: The no-op variant ensures zero performance overhead and prevents any logging in production builds.

🛠️ Integration

1. Ktor (KMP) Integration

For KMP projects, simply install the MonitorLogging feature in your HttpClient config.

install(MonitorLogging) {
    // 1. Mask sensitive headers (e.g., Bearer tokens)
    sanitizeHeader(placeholder = "****") { header -> 
        header == "Authorization" 
    }

    // 2. Filter specific hosts only
    filter { it.url.host.contains("github.com") }

    // 3. Customize the notification title
    setNotificationTitle("Recording Monitor Sample")
}

2. Retrofit / OkHttp Integration

For Android-only or Retrofit-based implementations, add the Interceptor to your OkHttp builder.

@Provides
fun provideOkHttpClient(): OkHttpClient {
    val okHttpClientBuilder = OkHttpClient.Builder()
        .connectTimeout(TimeoutType.DEFAULT_CON_TIMEOUT.timeout, TimeUnit.SECONDS)
        .addInterceptor(
            // Add Monitor Interceptor
            getInterceptor(notificationTitle = "Network Monitor Sample") as Interceptor
        )
    return okHttpClientBuilder.build()
}

✨ Key Features

🔒 Header Sanitization

Protect sensitive data by masking headers like Authorization or Cookie in the logs.

🎯 Host Filtering

Reduce noise by filtering logs to only show traffic from specific domains or environments.

📱 Built-in UI

Inspect requests, responses, and headers directly within the app using a clean, user-friendly interface.

🚀 Production Ready

Includes a no-op artifact to ensure safety and performance in release builds.

🌐 Cross-Platform

Full Kotlin Multiplatform support for Android, iOS, and JVM targets.

Zero Config

Works out of the box with sensible defaults, customize only what you need.

🤝 Comparison with Similar Tools

See how Network Monitor stacks up against other popular network debugging tools.

Feature Network Monitor Chucker Others
KMP Ktor Support
Retrofit Support
Header Sanitization
Host Filtering
No-Op Release Build
Multiplatform
Custom Notifications