Host Bridge Protocol
Package@consenger/companion-sdk@0.1.0-alpha.0
Protocolcompanion.plugin.v1
Runtimeiframe / WKWebView
StatusPublic alpha
The Companion SDK speaks a small JSON-RPC protocol with the Vifu host. Game code should use SDK methods instead of sending protocol messages directly.
Sources
| Source | Direction | Purpose |
|---|---|---|
consenger-game-runtime | game to host | Runtime notifications and responses. |
consenger-web-host | host to game | Vifu Web requests. |
consenger-ios-host | host to game | iOS WKWebView requests. |
Core methods
| Method | Direction | Description |
|---|---|---|
companion.initialize | host to game | Initializes the bridge and marks the host connected. |
companion.contexts/list | host to game | Lists registered contexts. |
companion.contexts/read | host to game | Reads a context snapshot. |
companion.commands/list | host to game | Lists registered commands. |
companion.commands/call | host to game | Requests a game command. |
companion.observe | game to host | Sends a routine observation. |
companion.signal | game to host | Sends a companion-visible signal. |
companion.runtime_ready | game to host | Announces browser bundle readiness. |
Rule
The game owns state and commands. The host may request command execution, but the game validates inputs and decides what changes.
