- Main process - a Node.js process that has access to the file system and operating system.
- Renderer process - a Chromium browser window that runs your React UI.
Supported runtimes
Plugins
Every Zenbu.js application is itself a plugin. Your app and any third-party plugin that extends it share the same set of capabilities. Everything described below applies equally to both.Services
Services are shared objects that run in the main process. They hold state, manage resources, and can depend on other services (dependency injection). Every public method on a service is automatically available to the renderer process via type-safe RPC.src/main/services/counter.ts
evaluate() re-runs immediately without restarting the app.
Database
Zenbu.js includes a JSON database that syncs across every process. Components that read from the database automatically re-render when the data they depend on changes.RPC
Every public method on a service becomes callable from the renderer process with full TypeScript inference. You define a service class in the main process and call it from React throughuseRpc().
Events
Services in the main process can emit events that the renderer process subscribes to. Events cross process boundaries automatically. A service emits an event throughthis.ctx.rpc.emit:
src/main/services/notifications.ts
useEvents():
Injections
When a plugin wants to add UI to the app, it registers an injection. The host already looks for injections in known places (sidebars, the bottom panel, the title bar, the footer) and renders them. A service registers one withthis.inject({ name, modulePath, meta }), and any other plugin discovers it with useInjections({ kind }) or renders it with <View name="..." />. The same primitive also covers advice and code that just needs to run at boot.
