electrobun-rpc
Installation
SKILL.md
Electrobun RPC — Typed Bun ↔ Webview Communication
Electrobun is NOT Electron. Do not use Electron APIs (ipcMain, ipcRenderer, contextBridge, etc.).
Mental Model
- Schema-first: Define types → derive handlers and callers. Types flow through generics to auto-complete method names, params, and responses.
- Two sides:
"bun"(main process, runs in Bun) and"webview"(browser). Each side defines what it handles (incoming requests) and what it receives (incoming messages). - Two patterns: Requests (async, returns a response) and messages (fire-and-forget, no response).
- Bun side uses
BrowserView.defineRPC("bun", ...). Browser side usesElectroview.defineRPC(...). - Transport is automatic: Encrypted WebSocket (per-webview AES-256-GCM) with native bridge fallback. You never configure transport manually.