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"✅
timestampnumber✅Unix ms
sessionIdstring✅Session ID from QR code
tokenstring✅Auth token from QR code
deviceInfo.idstring✅Device identifier
deviceInfo.modelstring✅Device model name
deviceInfo.platform"android" | "web"✅
deviceInfo.architecture"arm64" | "x86_64" | "x86"✅
deviceInfo.androidVersionstring—e.g. "14"
deviceInfo.apiLevelnumber—e.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✅
statusSessionStatus✅connecting | connected | idle | disconnected | error
messagestring—Optional detail

client:log​

FieldTypeRequiredDescription
type"client:log"✅
timestampnumber✅
sessionIdstring✅
log.idstring✅Unique log entry ID
log.timestampnumber✅
log.levelLogLevel✅verbose | debug | info | warn | error | fatal
log.tagstring✅Logcat tag
log.messagestring✅
log.sourceLogSource✅cli | 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✅
reasonstring—Human-readable disconnect reason

client:click​

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

FieldTypeRequiredDescription
type"client:click"✅
timestampnumber✅
sessionIdstring✅
actionstring✅e.g. "onClick"
elementTypestring✅e.g. "Button"
elementTextstring—Visible 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