Get Started

The purpose of this project is to provide a simple-to-use RPC framework for any environment JavaScript/TypeScript can run, not just http.
In fact, it was not created for http. http support is just a side effect of the design. If you are looking for a http RPC library, you might want to check out tRPC.
This project is created for building extension system for a Tauri app (https://github.com/kunkunsh/kunkun).
Its potential can be used in other types of apps, so I open sourced it as a standalone package.
Environment
Section titled “Environment”- http
- Make RPC calls over HTTP like calling local functions (similar to tRPC)
- WebSocket
- Make RPC calls over WebSocket
- Web Worker
- Make RPC calls over Web Worker (similar to comlink)
- iframe
- Make RPC calls over iframe (similar to comlink)
- stdio
- Make RPC calls over stdio between JavaScript/TypeScript processes (e.g. Node.js/Deno/Bun)
- Chrome Extension
- Make RPC calls between content script and background script
- Tauri
- Make RPC calls between Tauri app and bun/deno/node backend (like Electron)
All environments (except for http) support bidirectional calls and callbacks. i.e. both sides can expose API methods to each other on the same connection.
Install from NPM
Section titled “Install from NPM”bash npm install kkrpc bash bun add kkrpc bash pnpm add kkrpc Install from JSR
Section titled “Install from JSR”bash deno add jsr:@kunkun/kkrpc bash npx jsr add @kunkun/kkrpc bash bunx jsr add @kunkun/kkrpc bash pnpm dlx jsr add @kunkun/kkrpc Recommended Prerequisites
Section titled “Recommended Prerequisites”- Node.js 20+
- Bun
- Use this to run TypeScript directly (without compiling to JavaScript)
- Deno v2+
- Compatible with Node.js APIs