orpc-electron-adapter
Use oRPC inside an Electron project via Message Port Adapter.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use oRPC inside an Electron project via Message Port Adapter.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Quick reference for Better Notify configuration, patterns, and common gotchas
Interactive setup wizard for adding Better Notify to a TypeScript/JavaScript project
Context and API guidance for Better Notify — end-to-end typed notification infrastructure for Node.js
Seamlessly use AI SDK inside your oRPC projects without any extra overhead.
Use oRPC inside an Astro project.
Functions to encode and decode base64url strings (URL-safe variant of base64).
| name | oRPC Electron Adapter |
| description | Use oRPC inside an Electron project via Message Port Adapter. |
| license | MIT |
| metadata | {"author":"Ali Torki","homepage":"https://github.com/ali-master","version":"1.0.0"} |
Establish type-safe communication between processes in Electron using the Message Port Adapter.
Listen for a port sent from the renderer, then upgrade it:
import { RPCHandler } from '@orpc/server/message-port'
import { onError } from '@orpc/server'
const handler = new RPCHandler(router, {
interceptors: [onError(e => console.error(e))],
})
app.whenReady().then(() => {
ipcMain.on('start-orpc-server', async (event) => {
const [serverPort] = event.ports
handler.upgrade(serverPort)
serverPort.start()
})
})
Forward the port from renderer to main:
window.addEventListener('message', (event) => {
if (event.data === 'start-orpc-client') {
const [serverPort] = event.ports
ipcRenderer.postMessage('start-orpc-server', null, [serverPort])
}
})
const { port1: clientPort, port2: serverPort } = new MessageChannel()
window.postMessage('start-orpc-client', '*', [serverPort])
const link = new RPCLink({ port: clientPort })
clientPort.start()