Skip to main content
Extensions run code inside the Electron Main process. This allows you to utilize full Node.js APIs, interface with local operating system tools, listen to app lifecycle hooks, and control database storage.

Environment details

The extension backend executes in a Node.js process managed by Electron. Since it runs in the main thread, it has unrestricted access to the local machine, filesystem, and native dependencies (such as spawning pseudo-terminals via node-pty).

Entrypoint configuration

Your backend main script must build into scripts/main/mainEntry.cjs as a CommonJS module. The host application imports it during startup. Your entrypoint file must export an initialExtension function:

Initialization parameters

The initialization function receives three arguments:
  1. lynxApi: The central registry to subscribe to application startup triggers, window readiness, or inject tray menu items.
  2. utils: Utility getters to resolve major application class singletons (like storage, modules, and window managers) or access native node-pty methods.
  3. mainIpc: A structured wrapper namespace granting direct access to Core application IPC handlers.
Last modified on June 21, 2026