https://github.com/metacurb/electron-ipc-bridge
Type-safe, class-based IPC for Electron
https://github.com/metacurb/electron-ipc-bridge
dependency-injection electron electronjs vite
Last synced: 4 months ago
JSON representation
Type-safe, class-based IPC for Electron
- Host: GitHub
- URL: https://github.com/metacurb/electron-ipc-bridge
- Owner: metacurb
- License: mit
- Created: 2026-01-27T18:23:56.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-02-12T17:26:18.000Z (4 months ago)
- Last Synced: 2026-02-13T00:55:35.483Z (4 months ago)
- Topics: dependency-injection, electron, electronjs, vite
- Language: TypeScript
- Homepage: https://metacurb.github.io/electron-ipc-bridge/
- Size: 1.74 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Electron IPC Bridge
A type-safe, class-based IPC framework for Electron. Inspired by NestJS.
Define controllers in main, automatically get fully typed APIs in the renderer.
Documentation ·
Quickstart ·
Examples
---
## At a Glance
**Controller** (main process):
```ts
import { IpcController, IpcHandle } from "@electron-ipc-bridge/core";
@IpcController("users")
export class UserController {
@IpcHandle()
async getUser(id: string) {
return { id, name: "Alice" };
}
}
```
**Renderer**:
```ts
const user = await window.ipc.users.getUser("123");
console.log(user.name); // "Alice" is fully typed, auto-completed
```
## Features
- **Zero channel boilerplate:** channels are generated automatically
- **Auto-generated renderer types:** the Vite plugin analyses your controllers and outputs `d.ts` declarations
- **Parameter injection:** `@Sender()`, `@Window()`, `@RawEvent()`, `@Channel()`, and custom decorators
- **No manual preload wiring:** `setupPreload()` handles everything
- **DI-friendly:** bring your own container (TypeDI, NestJS, or a simple factory)
## Install
```bash
npm install @electron-ipc-bridge/core reflect-metadata
npm install -D @electron-ipc-bridge/vite-plugin
```
## Getting Started
Head to the **[Quickstart guide](https://metacurb.github.io/electron-ipc-bridge/quickstart)** for full setup instructions, including TypeScript config, Vite plugin setup, preload wiring, and your first controller.
## Documentation
Full documentation is available at **[metacurb.github.io/electron-ipc-bridge](https://metacurb.github.io/electron-ipc-bridge/)**.
## License
MIT