---
title: "Use Electron for desktop apps built from · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/mobile-and-desktop-apps/electron
id: STK-103
level: Default
updated: 2026-10-27
build: a2a6bdfed830
tokens: 854
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Use Electron for desktop apps built from web code

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Mobile and desktop apps](https://agentwranglers.se/playbook/stack/mobile-and-desktop-apps.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: STK-103
- Level: Default
- Chapter: [Mobile and desktop apps](https://agentwranglers.se/playbook/stack/mobile-and-desktop-apps.md)
- Rule: Build a Mac, Windows and Linux app from web code with Electron, on one of its three newest major versions.
- Check: The `electron` version in `package.json` has a major version among the newest three on the Electron releases page.
- Review by: 2027-04-30
- Cost: Open source. Code signing for Mac and Windows costs money whichever framework you pick.
- How: The `electron` npm package has shipped stable versions since July 2016. Electron 45.0.0 came out on 21 October 2026, with about 5.0 million weekly downloads and an MIT licence. Its makers patch only the newest three major versions, which are 43, 44 and 45 today. A new major arrives about every 8 weeks, so plan the upgrade as [Keep the bundled browser engine current](https://agentwranglers.se/playbook/desktop-apps/update-integrity/current-app-runtime.md) says. Keep web content apart from the operating system, as [Keep web content away from the operating system](https://agentwranglers.se/playbook/desktop-apps/web-code-inside-desktop-apps/isolate-web-content.md) explains. Choose something else when download size or memory matters most. Tauri uses the system's own web view and makes far smaller apps. Tauri reached 1.0.0 in June 2022, so it fails the five-year test until June 2027. Record that choice in a decision record.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
import { app, BrowserWindow } from 'electron';

app.whenReady().then(() => {
  const window = new BrowserWindow({ webPreferences: { contextIsolation: true, sandbox: true, nodeIntegration: false } });
  window.loadFile('index.html');
});
```

## Sources

- [Electron release timelines and support policy](https://www.electronjs.org/docs/latest/tutorial/electron-timelines)

## Related rules

- DSK-9 [Keep the bundled browser engine current](https://agentwranglers.se/playbook/desktop-apps/update-integrity/current-app-runtime.md) in Desktop apps and extensions
- DSK-10 [Keep web content away from the operating system](https://agentwranglers.se/playbook/desktop-apps/web-code-inside-desktop-apps/isolate-web-content.md) in Desktop apps and extensions

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/mobile-and-desktop-apps/electron">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Use React Native with Expo for phone apps](https://agentwranglers.se/playbook/stack/mobile-and-desktop-apps/react-native-expo.md)
- [Mobile and desktop apps](https://agentwranglers.se/playbook/stack/mobile-and-desktop-apps.md)
