A Kotlin Multiplatform library that adds an in-app developer overlay to Android and iOS apps. The overlay hosts pluggable modules for feature flags, analytics inspection, and network mocking.
Full documentation:worldline.github.io/devview
- Android minSdk 26
- iOS 16+
- Kotlin 2.x
- Compose Multiplatform
DevView is published to Maven Central. Add the modules you need to your shared KMP module:
// build.gradle.kts (shared / commonMain)
dependencies {
implementation("com.worldline.devview:devview:<version>") // core — always required
implementation("com.worldline.devview:devview-featureflip:<version>") // feature flags
implementation("com.worldline.devview:devview-analytics:<version>") // analytics inspector
implementation("com.worldline.devview:devview-timecapsule:<version>") // per-screen state history
implementation("com.worldline.devview:devview-networkmock:<version>") // network mock UI// Ktor plugin only (no UI — lightweight alternative for network-layer integration)
implementation("com.worldline.devview:devview-networkmock-core:<version>")
implementation("com.worldline.devview:devview-networkmock-ktor:<version>")
}@Composable
funMyApp() {
val modules = rememberModules {
module(module =FeatureFlip)
module(module =Analytics())
module(
module =NetworkMock(
resourceLoader = { path ->Res.readBytes(path = path) }
)
)
}
var devViewOpen by remember { mutableStateOf(false) }
// Your existing app contentAppContent(onOpenDevView = { devViewOpen =true })
// DevView overlayDevView(
devViewIsOpen = devViewOpen,
closeDevView = { devViewOpen =false },
modules = modules
)
}rememberModules handles DataStore initialisation and module setup automatically. DevView renders as a transparent overlay on top of your content.
Define flags and provide the handler to the composition:
val featureHandler = rememberFeatureHandler(
features =listOf(
Feature.LocalFeature(name ="dark_mode", description ="Enable dark theme", isEnabled =false),
Feature.RemoteFeature(
name ="new_checkout",
description ="New checkout experience",
defaultRemoteValue = remoteConfig.getBoolean("new_checkout"),
state =FeatureState.REMOTE
)
)
)
CompositionLocalProvider(LocalFeatureHandler provides featureHandler) {
// Read flags anywhere in the treeval isDarkMode by LocalFeatureHandler.current.isFeatureEnabled("dark_mode")
}Forward events to AnalyticsLogger from your existing analytics layer:
AnalyticsLogger.log(
AnalyticsLog(
tag ="purchase_completed",
screenClass ="CheckoutScreen",
timestamp =Clock.System.now().toEpochMilliseconds(),
type =AnalyticsLogCategory.Ecommerce.Purchase
)
)Provide the log list above DevView:
CompositionLocalProvider(LocalAnalytics provides AnalyticsLogger.logs) { … }Place your mock config at composeResources/files/networkmocks/mocks.json and install the plugin:
val client =HttpClient(OkHttp) {
install(NetworkMockPlugin)
}rememberModules { } must be called (and composed) before the first HTTP request reaches this client.
Implement TimeCapsuleOwner on a screen's state holder and record it with one call:
classCounterViewModel : ViewModel(), TimeCapsuleOwner<CounterState> {
overrideval state:StateFlow<CounterState> =_state.asStateFlow()
overridefunrestoreState(state:CounterState) { _state.value = state }
}
@Composable
funCounterScreen(viewModel:CounterViewModel) {
TimeCapsuleEffect(owner = viewModel)
}The recorded history resets automatically when the screen leaves composition.
| Module | Artifact | Description |
|---|---|---|
| Core | devview | DevView composable + rememberModules DSL. Required by all modules. |
| FeatureFlip | devview-featureflip | Runtime feature flag management with Compose UI. Supports local and remote-config flags with local overrides. |
| Analytics | devview-analytics | Real-time analytics event inspector with filtering by type, category, and time range. |
| TimeCapsule | devview-timecapsule | Records the state history of the currently visible screen and lets you restore any earlier state back into it. |
| NetworkMock (UI) | devview-networkmock | Full mock management UI: enable/disable endpoints, switch responses, preview and diff mock payloads. |
| NetworkMock Core | devview-networkmock-core | Mock engine: JSON config parsing, request matching, DataStore state. No UI dependency. |
| NetworkMock Ktor | devview-networkmock-ktor | Ktor HttpClientPlugin that intercepts requests and returns mock responses. |
DevView's build infrastructure, CI setup, and library conventions draw inspiration from chrisbanes/haze. Many thanks to Chris Banes for open-sourcing that work.