Skip to content

Universal DevTools Kit SDK


Universal DevTools Kit SDK / @u-devtools/bridge

@u-devtools/bridge ​

npm versionnpm downloadsLicenseDonate

RPC bridge for Universal DevTools communication. Handles typed RPC calls between Server and Client contexts via Vite HMR WebSocket.

Installation ​

bash
npm install -D @u-devtools/bridge

Usage ​

ts
import { ViteRpcClient, ViteRpcServer } from '@u-devtools/bridge';

// Client side
const rpc = new ViteRpcClient(import.meta.hot);
await rpc.call('method:name', payload);

// Server side
const rpc = new ViteRpcServer(server.ws);
rpc.handle('method:name', async (payload) => { /* ... */ });

Repository ​

GitHub

Classes ​

Released under the MIT License.