Build IPC for Electron with tRPC
- Expose APIs from Electron's main process to one or more render processes.
- Build fully type-safe IPC.
- Secure alternative to opening servers on localhost.
- Full support for queries, mutations, and subscriptions.
- NEW: Support for async generators and streaming data.
This is a fork of electron-trpc by @jsonnull with significant contributions from @mat-sz. This version includes:
- Component Separation: Split into distinct
main
,preload
, andrenderer
components for better organization - tRPC v11 Support: Updated to support the latest tRPC v11 features and improvements
- Async Generators: Full support for async generators enabling real-time streaming data
- Modern Architecture: Enhanced separation of concerns following Electron's security model
npm install electron-trpc-experimental
- Install the package and follow our Getting Started guide
- Explore the examples in the
examples/
directory:basic-react
- Basic React setup with TypeScriptbasic-react-superjson
- Using SuperJSON transformers
- Getting Started - Setup guide and basic usage
- Examples - Working examples with different configurations
- Type-safe IPC - Full TypeScript support across main/preload/renderer processes
- tRPC v11 Support - Latest tRPC features and improvements
- Async Generators - Support for streaming data and real-time updates
- Transformers - Use SuperJSON and other transformers for complex data types
- Security-first - Built on Electron's context isolation for secure IPC