Skip to main content

WebSocket Protocol API Reference

Full message-level reference for the JetStart WebSocket protocol. For a conceptual overview and connection flow diagrams, see Architecture: WebSocket Protocol.

Endpoints

ServerDefault PortPurpose
Core WebSocket8766Hot reload, build events, auth
Logs WebSocket8767Log streaming (separate protocol)

Client → Core Messages

client:connect

Must be the first message sent after opening the WebSocket.

FieldTypeRequiredDescription
type"client:connect"
timestampnumberUnix ms
sessionIdstringSession ID from QR code
tokenstringAuth token from QR code
deviceInfo.idstringDevice identifier
deviceInfo.modelstringDevice model name
deviceInfo.platform"android" | "web"
deviceInfo.architecture"arm64" | "x86_64" | "x86"
deviceInfo.androidVersionstringe.g. "14"
deviceInfo.apiLevelnumbere.g. 34

Success response: core:connected
Failure: WebSocket closed with code 4001 (session mismatch) or 4002 (token mismatch)


client:status

FieldTypeRequiredDescription
type"client:status"
timestampnumber
statusSessionStatusconnecting | connected | idle | disconnected | error
messagestringOptional detail

client:log

FieldTypeRequiredDescription
type"client:log"
timestampnumber
sessionIdstring
log.idstringUnique log entry ID
log.timestampnumber
log.levelLogLevelverbose | debug | info | warn | error | fatal
log.tagstringLogcat tag
log.messagestring
log.sourceLogSourcecli | core | client | build | network | system
log.metadataobject

client:heartbeat

FieldTypeRequired
type"client:heartbeat"
timestampnumber

Sent every 30 seconds. No response expected.


client:disconnect

FieldTypeRequiredDescription
type"client:disconnect"
timestampnumber
reasonstringHuman-readable disconnect reason

client:click

Web emulator only. Android clients do not send this message.

FieldTypeRequiredDescription
type"client:click"
timestampnumber
sessionIdstring
actionstringe.g. "onClick"
elementTypestringe.g. "Button"
elementTextstringVisible label of the element

Core → Client Messages

core:connected

FieldTypeDescription
type"core:connected"
timestampnumber
sessionIdstringEchoes back the authenticated session
projectNamestringHuman-readable project name

core:build-start

FieldType
type"core:build-start"
timestampnumber
sessionIdstring

core:build-status

FieldTypeDescription
type"core:build-status"
timestampnumber
sessionIdstring
statusBuildStatusProgress indicator string

core:build-complete

FieldTypeDescription
type"core:build-complete"
timestampnumber
sessionIdstring
apkInfo.pathstringServer-side path to APK
apkInfo.sizenumberBytes
apkInfo.hashstring
apkInfo.versionCodenumber
apkInfo.versionNamestring
apkInfo.minSdkVersionnumberMinimum 24
apkInfo.targetSdkVersionnumber
apkInfo.applicationIdstringe.g. com.example.app
downloadUrlstringFull HTTP URL to download the APK

core:build-error

FieldTypeDescription
type"core:build-error"
timestampnumber
sessionIdstring
errorstringShort error summary
detailsany— Optional extended detail

core:dex-reload

Primary hot reload message for Android devices. Carries DEX bytecode compiled from the changed Kotlin file.

FieldTypeDescription
type"core:dex-reload"
timestampnumber
sessionIdstring
dexBase64stringBase64-encoded classes.dex
classNamesstring[]Fully-qualified names of all patched classes

classNames includes both the original class and any $Override companion classes generated during the pipeline.


core:js-update

Hot reload message for the web emulator. Android clients should ignore this message.

FieldTypeDescription
type"core:js-update"
timestampnumber
sessionIdstring
jsBase64stringBase64-encoded ES module (.mjs)
sourceFilestringSource .kt filename that triggered this update
byteSizenumberDecoded size in bytes

core:ui-update

DSL-based UI update for the web emulator fallback renderer.

FieldTypeDescription
type"core:ui-update"
timestampnumber
sessionIdstring
dslContentstringJSON string of the DSL component tree
screensstring[]— Affected screen names
hashstring— Content hash for change detection

core:reload

FieldTypeDescription
type"core:reload"
timestampnumber
sessionIdstring
reloadType"hot" | "full"

core:log

Broadcast of a device log entry to dashboard/CLI clients.

FieldTypeDescription
type"core:log"
timestampnumber
sessionIdstring
logLogEntrySame shape as client:log.log

core:disconnect

FieldTypeDescription
type"core:disconnect"
timestampnumber
reasonstringe.g. "Server stopped"

WebSocket Close Codes

CodeReasonClient action
4001Session mismatchRescan QR code
4002Token mismatchRescan QR code
1001Server going awayRetry after server restarts
1000Normal closureNo action needed