Web SDK (Kotlin/Wasm)

Web

Experimental. The web SDK targets Kotlin/Wasm apps and currently ships from source (Maven artifacts for the wasmJs target are not published yet). For inspecting any web page from the outside, use the Chrome Extension instead.

The core Snapbug SDK and the Analytics plugin compile to WebAssembly (wasmJs target). A Kotlin/Wasm web app can connect to the inspector over WebSocket exactly like an Android or iOS device and stream:

  • Logsconsole.log/info/warn/error/debug are hooked and forwarded in real time
  • Analytics — the same Snapbug.analytics(...).logEvents(...) API as on mobile

Setup

Add the SDK to your app's wasmJs target and start it:

import io.snapbug.sdk.SnapbugContext
import io.snapbug.sdk.startSnapbug
import io.snapbug.sdk.plugins.analytics.SnapbugAnalytics
import io.snapbug.sdk.plugins.logs.SnapbugLogs
 
fun main() {
    startSnapbug(SnapbugContext()) {
        install(SnapbugAnalytics)
        install(SnapbugLogs)
    }
}

By default the SDK connects to an inspector on localhost — the typical local-development setup where the page and the inspector run on the same machine.

What's next

Device info, crash reporting, and network capture on the web target are on the roadmap, along with published Maven artifacts.