electron/preload.js

Secure renderer bridge exposing native Electron APIs to the frontend.

CategoryElectron
Sourceelectron/preload.js

What it does

Secure renderer bridge exposing native Electron APIs to the frontend.

Key responsibilities

  • Uses contextBridge to safely expose a narrow set of Electron APIs to the browser UI.
  • Provides window control commands, native notifications, clipboard access, and OAuth popup handling.
  • Reads the local .env file to make the Luna API key available to the renderer without exposing the full filesystem.
  • Exposes an API base URL and Electron runtime detection helpers for frontend networking.

Related files

Explore other files in the Electron category.