DevToolsConfig

data class DevToolsConfig(val introspectionConfig: IntrospectionConfig, val serverUrl: String? = null, val enabled: Boolean = true, val allowActionCapture: Boolean = true, val allowStateCapture: Boolean = true, val defaultRole: ClientRole? = null)(source)

Configuration for DevTools middleware.

Identity properties (clientId, clientName, platform) are read from the shared IntrospectionConfig, ensuring consistent identification across introspection and DevTools.

Example usage:

val introspectionConfig = IntrospectionConfig(
clientName = "MyApp",
platform = "${Build.MANUFACTURER} ${Build.MODEL}"
)

val config = DevToolsConfig(
introspectionConfig = introspectionConfig,
serverUrl = "ws://192.168.1.100:8080/ws",
defaultRole = ClientRole.PUBLISHER
)

Example usage for ad-hoc connection (connect later via action):

val config = DevToolsConfig(
introspectionConfig = introspectionConfig,
serverUrl = null // Don't auto-connect
)

// Later, connect via dispatched action:
dispatch(DevToolsAction.Connect("ws://192.168.1.100:8080/ws"))

Parameters

introspectionConfig

Shared configuration providing clientId, clientName, and platform

serverUrl

WebSocket server URL. If null, won't auto-connect (use DevToolsAction.Connect)

enabled

Enable/disable DevTools functionality

allowActionCapture

Allow sending dispatched actions to the DevTools server

allowStateCapture

Allow sending state changes to the DevTools server

defaultRole

The role to request automatically on connect. Null means no auto-request.

Constructors

Link copied to clipboard
constructor(introspectionConfig: IntrospectionConfig, serverUrl: String? = null, enabled: Boolean = true, allowActionCapture: Boolean = true, allowStateCapture: Boolean = true, defaultRole: ClientRole? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val defaultRole: ClientRole? = null
Link copied to clipboard
val enabled: Boolean = true
Link copied to clipboard
Link copied to clipboard
val serverUrl: String? = null