← Back to archive

Repo of the Day

Cap-go/electron-updater: OTA (Over-The-Air) updates for Electron applications. 100% feature parity with @capgo/capacitor-updater.

Published: Aug 19, 2026

Open repository ↗

OTA (Over-The-Air) updates for Electron applications. 100% feature parity with @capgo/capacitor-updater. - Cap-go/electron-updater

Summary

@capgo/electron-updater is an open-source OTA (Over-The-Air) update library for Electron applications, written in TypeScript. It is positioned as an alternative to Electron's built-in auto-updater, allowing JavaScript, HTML, and CSS changes to be delivered to users without rebuilding the full app binary. The project is published under the Mozilla Public License 2.0 and is described in the README as having 100% feature parity with @capgo/capacitor-updater.

What it is useful for

The library is useful when an Electron app team needs to deliver fixes and content changes faster than the full release cycle allows. Rather than shipping a new native binary for each change, the updater downloads a web bundle, supports delta-style updates, and reverts to the last successful bundle if a new one fails to load. It also offers channels for staging releases to subsets of users, delay conditions (background, kill, date, nativeVersion) for controlling when an update takes effect, and an end-to-end encrypted delivery path configured with a publicKey in the updater options.

How engineers can use it

The README documents installation via npm:

npm install @capgo/electron-updater

A working setup touches three files. In the main process, instantiate ElectronUpdater and call initialize(window, builtinPath), then register IPC handlers and event forwarding:

import { ElectronUpdater, setupIPCHandlers, setupEventForwarding } from '@capgo/electron-updater';

const updater = new ElectronUpdater({ appId: 'com.example.app', autoUpdate: true });
await updater.initialize(mainWindow, path.join(__dirname, 'www/index.html'));
setupIPCHandlers(updater);
setupEventForwarding(updater, mainWindow);
await mainWindow.loadFile(updater.getCurrentBundlePath());

In the preload script, expose the API with exposeUpdaterAPI() from @capgo/electron-updater/preload. In the renderer, import requireUpdater from @capgo/electron-updater/renderer and call await updater.notifyAppReady() on every launch so the rollback timer (default 10,000 ms) does not expire. From there, getLatest(), download({ url, version, checksum }), and next({ id }) let a renderer drive the update flow manually. A debug menu can be enabled with debugMenu: true and triggered with Ctrl+Shift+D (or Cmd+Shift+D on macOS) to inspect and switch bundles.

Documented limitations and caveats: the README does not describe a code-signing or native-module update flow, so changes to native dependencies still require a full app release. The README also notes that the device ID is stored using Electron's safeStorage rather than a platform keystore, the debug menu is a keyboard shortcut instead of a device shake, and background detection relies on BrowserWindow blur/focus events rather than native lifecycle events.