kkrpc

Enable bidirectional, type-safe RPC between Node, browser and other runtimes via multiple transports.

172|5|Updated Nov 17, 2024
One-click install
npx skills add https://github.com/kunkunsh/kkrpc --skill kkrpc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kkrpc
Source: https://github.com/kunkunsh/kkrpc/tree/main/skills/kkrpc
Command: npx skills add https://github.com/kunkunsh/kkrpc --skill kkrpc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bidirectional, type-safe RPC between multiple runtimes and environments, enabling seamless API exposure and remote invocation across Node, Deno, Bun, and browsers.

Core Features & Use Cases

  • Bidirectional RPC with type-safe APIs
  • Supports multiple transports (stdio, WebSocket, HTTP, workers, postMessage, etc.)
  • Flexible serialization (json by default, superjson for TS-only)
  • Advanced features: callbacks, property access, error handling, validation, transferable objects
  • Use cases: microservices, client-server plugins, cross-runtime tooling

Quick Start

Create an RPCChannel between a server that exposes APIs and a client that consumes them.

Frequently Asked Questions about kkrpc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable bidirectional RPC between Node and browser runtimes?

Bidirectional RPC between Node, Deno, Bun, and browsers is enabled by creating an RPCChannel that exposes APIs on a server and consumes remote methods on a client using type-safe interfaces.

What transports can I use for cross-runtime TypeScript RPC?

Cross-runtime TypeScript RPC supports multiple transports including stdio, WebSocket, HTTP, workers, and postMessage, allowing flexible communication channels between different environments.

How does serialization work for type-safe RPC methods?

Serialization for type-safe RPC methods defaults to JSON, with superjson available for TypeScript-only environments to preserve type fidelity during remote method invocation and data transfer.

Can I use callbacks and property access in a cross-runtime RPC setup?

Cross-runtime RPC supports advanced features like callbacks, property access, error handling, validation, and transferable objects for complex client-server plugin and microservice architectures.

Does this RPC library support validation and error handling for exposed APIs?

The RPC library includes optional validators and built-in error handling for exposed APIs, ensuring robust remote invocation failures are caught and managed across different runtimes.

What is the best way to build microservices with cross-runtime tooling?

Building microservices with cross-runtime tooling is best achieved by exposing APIs and consuming remote methods bidirectionally across Node, Deno, Bun, and browsers using flexible transport adapters.