Appearance
Ergonomic and type-safe solution for building IPC in Electron
function HelloElectron() {
const { data } = trpcReact.greeting.useQuery({
name: 'Electron',
});
if (!data) return null;
return <div>{data.text}</div>; // Hello Electron
}
export const router = t.router({
greeting: t.procedure
.input(z.object({ name: z.string() }))
.query(({ input }) => {
return {
text: `Hello ${input.name}`,
};
}),
});
Expose APIs from electron's main process to one or more renderer processes.
Build electron IPC with all the benefits of tRPC, including inferred client types.
Electron IPC is faster and more secure than opening local servers for IPC.
Supports all tRPC features. No need to write complicated bi-directional IPC schemes.