Runtime Bridge
API reference for @use-crux/core/runtime-bridge schemas and command-plane helpers.
import {
BridgeCommandRequestSchema,
BridgeCommandResultSchema,
RuntimeBridgeMessageSchema,
RuntimePeerHelloSchema,
connectRuntimeBridge,
executeRuntimeBridgeCommand,
getRuntimeBridgeManifest,
} from "@use-crux/core/runtime-bridge";The Runtime Bridge is the local-dev command plane between the @use-crux/local Go service and a live application runtime. It is used for inspectable resources and framework-specific local commands. It is not the execution trace transport; runtime traces use @use-crux/core/observability.
The stable runtime-peer command surface currently includes store.read for registered inspectable resources. Arbitrary runtime evaluation is intentionally not part of the bridge command contract.
Command errors
Failed commands return command.error with a stable error message and structured details. Runtime peers normalize thrown values with the same observability error contract used by spans, including thrown, summary, name, message, optional stack, safe raw data, phase, and errorKind when known.
The local Go bridge preserves those details for WebSocket and HTTP bridge commands, and emits command.failed events for failed dispatches.
Schemas
| Export | Description |
|---|---|
RuntimeBridgeConfigSchema | Runtime bridge configuration accepted by Crux config/integrations. |
RuntimeBridgeMessageSchema | Union schema for bridge messages. |
RuntimePeerHelloSchema | Peer handshake payload. |
BridgeCommandRequestSchema | Command request sent by the Go service to a runtime peer. |
BridgeCommandResultSchema | Successful command response. |
BridgeCommandErrorSchema | Failed command response. |
Helpers
| Export | Description |
|---|---|
getRuntimeBridgeManifest() | Returns the runtime peer manifest exposed to the local service. |
connectRuntimeBridge() | Connects a long-lived runtime peer. |
executeRuntimeBridgeCommand() | Executes a typed bridge command against registered runtime resources. |
Related
- Reference: Devtools Plugin
- Reference: @use-crux/local
- Guide: Devtools