TraceFlow is a powerful Kotlin Multiplatform network inspection library designed for modern mobile and desktop applications. It provides real-time visibility into your app's network traffic directly on the device, making debugging and monitoring effortless.
- 🔍 Real-time Network Monitoring - Watch HTTP requests and responses as they happen
- 📱 Cross-Platform Support - Works seamlessly on Android, iOS, and Desktop applications
- 🎯 Ktor Integration - Built specifically for Ktor-based networking stacks
- 📊 Session Tracking - Distinguishes between current and previous app sessions
- 🔒 Privacy-Focused - Configurable data redaction and retention policies
- ⚡ Lightweight - Minimal performance impact on your application
- 🎨 Native UI - Platform-appropriate interfaces for optimal user experience
- Kotlin Multiplatform project
- Ktor client library (version 2.3.1 or higher)
- Android API level 21+ / iOS 12+ / Desktop JVM
Add the library to your commonMain dependencies:
repositories {
mavenCentral()
}commonMain.dependencies {
implementation("io.github.TraceFlowTeam:TraceFlow-ktor3:{mavenVersion}")
}commonMain.dependencies {
implementation("io.github.TraceFlowTeam:TraceFlow-ktor2:{mavenVersion}")
}Integrate TraceFlow into your Ktor client with a single line:
val httpClient = HttpClient() {
install(ContentNegotiation) {
json()
}
install(TraceFlowKtor) // That's it! 🎉
}Depending on your iOS framework configuration:
Add -lsqlite3 to Other Linker Flags in your Xcode project settings.
iosTarget.binaries.all {
linkerOpts("-lsqlite3")
}TraceFlow offers extensive customization options to fit your development needs:
- 🤖 Auto-Detection - Automatically identify network configurations
- 📝 Log Levels - Control verbosity of network logging
- 🗂️ Data Retention - Manage how long network data is stored
- ⌨️ Shortcuts - Quick access shortcuts for mobile platforms
- 🚫 Release Exclusion - Keep TraceFlow out of production builds
- 🔐 Data Redaction - Sensitive data protection and masking
- 🎯 Endpoint Filtering - Ignore specific endpoints from tracking
Experience TraceFlow in action with our comprehensive sample project:
# Clone and run the sample
git clone https://github.com/shubham230523/TraceFlow
cd TraceFlowSample
./gradlew :composeApp:runSwitch between Ktor versions:
# In gradle.properties
TraceFlow.ktorVersion=v3 # or v2 for legacy supportTraceFlow follows clean architecture principles with clear separation of concerns:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Presentation │ │ Domain │ │ Data │
│ │ │ │ │ │
│ • UI Components │ │ • Use Cases │ │ • Repositories │
│ • ViewModels │ │ • Models │ │ • Data Sources │
│ • Navigation │ │ • Interfaces │ │ • Mappers │
└─────────────────┘ └─────────────────┘ └─────────────────┘
We welcome contributions from the community! Here's how you can help:
- 🐛 Report Issues - Found a bug? Let us know!
- 💡 Feature Requests - Have an idea? We'd love to hear it
- 🔧 Pull Requests - Submit improvements and fixes
- 📚 Documentation - Help us improve our docs
git clone https://github.com/shubham230523/TraceFlow
cd TraceFlow
./gradlew buildTraceFlow is designed with performance in mind:
- < 2% CPU overhead during active monitoring
- < 5MB additional memory footprint
- Zero impact when monitoring is disabled
- Asynchronous processing to avoid blocking main thread
Your data security is our priority:
- Local storage only - no data leaves the device
- Configurable data redaction for sensitive information
- Automatic data cleanup based on retention policies
- Optional exclusion from release builds