Development-only bridge that captures errors, logs, and optional controls from your app and streams them to a workspace host. Works across web, Node.js, React Native, Roblox/Lua (HTTP), and thin backend SDKs.
- Usage & configuration: docs/usage.md
- Language quickstarts: docs/clients/README.md
- SDK status matrix: docs/clients/status.md
- Roblox / Lua guide: docs/clients/roblox.md
npm install @just-every/code-bridge
# or yarn add / pnpm add- Start the host (writes
.code/code-bridge.jsonwithurl+secret):
npx code-bridge-host- Bootstrap the bridge early in your app:
import { startBridge } from '@just-every/code-bridge';
startBridge({
url: process.env.CODE_BRIDGE_URL, // or read from .code/code-bridge.json
secret: process.env.CODE_BRIDGE_SECRET,
projectId: 'my-app',
enableControl: false, // opt-in features; see docs/usage.md
});- In React Native, the same call works; in Node.js you can also enable network/control capture.
Export CODE_BRIDGE_URL and CODE_BRIDGE_SECRET (read them from .code/code-bridge.json), then run:
| Language | Dev one-liner | Docs |
|---|---|---|
| Roblox / Lua | npm run copy:lua-client (then require CodeBridge.lua) |
guide |
| Python | python python/examples/basic_usage.py |
guide |
| Go | go run go/examples/main.go |
guide |
| PHP | php php/examples/basic.php |
guide |
| Ruby | bundle exec ruby ruby/examples/basic.rb |
guide |
| Rust | cargo run --example basic --manifest-path rust/Cargo.toml |
guide |
| Swift | swift run --package-path swift CodeBridgeExample |
guide |
| Java (scaffold) | npm run sdk:java |
guide |
code-bridge-host is a singleton WebSocket server per workspace. It locks at .code/code-bridge.lock, writes .code/code-bridge.json with url, port, and secret, and fans out events from bridges to consumers (e.g., Code, MCP). Start it with npx code-bridge-host [workspace-path].
- Node demo:
npm test(runsdemo/node-demo.js, assumes host running) - Web demo:
npm run buildthen opendemo/web-demo.html - Workspace bridge demo:
node demo/workspace-bridge-demo.js /path/to/workspace
MIT