---
title: Live Updates for Electron Desktop Apps
description: Deliver Capawesome Cloud Live Updates to Capacitor Electron desktop apps on macOS, Windows, and Linux — setup, versioned channels, CLI flags, and differences to mobile.
tags:
  - Electron
---

# Update Electron Apps

Live Updates work for desktop apps built with the [Capacitor Electron platform](../../sdks/capacitor/electron.md) the same way as on Android and iOS: the Live Update SDK downloads a new web bundle, the platform serves it, and the packaged Electron binary stays untouched. A desktop app uses the **same Capawesome Cloud app and app ID** as your mobile app — no changes in the Console are required.

This page covers what is specific to Electron. For the general setup — creating an app, configuring the SDK, and publishing your first bundle — follow [Get Started](setup.md) first.

## Prerequisites

- A **Capacitor 8** app with Live Updates set up as described in [Get Started](setup.md). The Capacitor 6 and 7 LTS releases of the SDK do not include the Electron implementation.
- `@capawesome/capacitor-electron` version `0.2.0` or later.
- `@capawesome/capacitor-live-update` version `8.5.0` or later.

## Installation

Add the Electron platform to your project:

```bash
npm install @capawesome/capacitor-electron
npx cap add @capawesome/capacitor-electron
cd electron && npm install && cd ..
```

Then sync your project. The Electron implementation of the Live Update SDK is registered automatically during the sync, so no additional configuration is required:

```bash
npx cap sync @capawesome/capacitor-electron
```

!!! warning "Always use the full package name"

    A bare `npx cap sync` only processes Android, iOS, and web, and `npx cap sync electron` resolves to the unrelated `electron` npm package and silently does nothing. Always pass `@capawesome/capacitor-electron` to Capacitor CLI commands.

For packaging, live reload, and other platform details, see the [Capacitor Electron platform](../../sdks/capacitor/electron.md) documentation.

## Configuration

The SDK reads the `LiveUpdate` section of your Capacitor configuration on Electron as well, so the `appId`, `autoUpdateStrategy`, `readyTimeout`, and all other options from [Get Started](setup.md#step-3-configure-the-sdk) apply unchanged.

### App version

On Electron, the app version is the `version` field of `electron/package.json`. The SDK reports it as both `versionCode` and `versionName`, and Capawesome Cloud uses it to decide which bundles are compatible with the installed app. The scaffolded project starts at `0.0.0`.

!!! danger "Bump the version for every desktop release"

    Version constraints can only distinguish desktop releases if each one has its own `version`. Keep `electron/package.json` in sync with your release process — for example by bumping it together with your mobile version codes.

### Versioned channel

[Versioned channels](channels.md#versioned-channels) pin each release to its own channel. On Android and iOS, the channel is set natively at build time. On Electron, set it in the `plugins` section of `electron/capacitor.electron.config.ts`. The file is executable TypeScript, so the channel can be derived from the app version:

```typescript title="electron/capacitor.electron.config.ts"
import { defineConfig } from "@capawesome/capacitor-electron/config";
import packageJson from "./package.json";

export default defineConfig({
  plugins: {
    LiveUpdate: {
      defaultChannel: `production-${packageJson.version}`,
    },
  },
});
```

The `plugins` section is merged over the `plugins` section of your Capacitor configuration **per plugin key, and the Electron configuration wins**: keys you set here override the same keys in `capacitor.config.ts`, while keys you don't mention are kept. Importing `./package.json` requires `resolveJsonModule` in `electron/tsconfig.json`, which the scaffold already enables.

## Publish an update

Publishing works exactly as described in [Publish an Update](publish.md). Upload the same web assets you ship to mobile:

```bash
npm run build
npx @capawesome/cli apps:liveupdates:upload --channel production-1.2.0
```

Electron devices receive the latest `zip` bundle of their channel, subject to the same [rollouts](rollouts.md), [rollbacks](rollbacks.md), and [code signing](code-signing.md) rules as mobile devices.

### Versioned bundles

If you use [versioned bundles](bundles.md#versioned-bundles) instead of versioned channels, restrict a bundle to a range of Electron app versions with the `--electron-min`, `--electron-max`, and `--electron-eq` flags on [`apps:liveupdates:upload`](../cli/commands.md#appsliveupdatesupload) and [`apps:liveupdates:register`](../cli/commands.md#appsliveupdatesregister):

```bash
npx @capawesome/cli apps:liveupdates:upload \
  --channel production \
  --electron-min 1.2 \
  --electron-max 1.3.5
```

The value is the Electron app version in the format `major[.minor[.patch]]`, where omitted components count as `0` (`1.2` matches `1.2.0`). Prerelease suffixes are not supported in the flags; a prerelease suffix in the installed app version (for example `1.3.0-beta.1`) is ignored when matching. `--electron-eq` excludes a single exact version, like `--android-eq` and `--ios-eq`.

The Electron flags are independent of the Android and iOS flags: a bundle without Electron constraints is delivered to every Electron version, and `--android-*` and `--ios-*` constraints never affect Electron devices.

## Differences to Android and iOS

- **App version**: Both `versionCode` and `versionName` are the `version` from `electron/package.json`. See [App version](#app-version).
- **Artifact type**: Only `zip` bundles are delivered to Electron devices, so [delta updates](bundle-size.md#delta-updates-manifest) are not available.
- **Automatic rollback**: The rollback is kill-safe: if the app is closed or crashes before `ready()`, it happens on the next start.
- **Storage**: Bundles and state live in the `capawesome-live-update` directory inside the app's [`userData`](https://www.electronjs.org/docs/latest/api/app#appgetpathname){:target="_blank"} directory.
- **Default channel**: Configured in `electron/capacitor.electron.config.ts` instead of `strings.xml` or `Info.plist`. See [Versioned channel](#versioned-channel).
- **Binary updates**: Changes to the `electron/` project, Electron itself, or a plugin's Electron implementation need a new desktop release, for example via [electron-updater](https://www.electron.build/auto-update){:target="_blank"}.

## Troubleshooting

Start with the general [Troubleshooting](troubleshooting.md) page. The following issues are specific to Electron:

- **`npx cap sync electron` does nothing**: The command resolves to the `electron` npm package, not the platform. Run `npx cap sync @capawesome/capacitor-electron` instead.
- **Every desktop release reports version `0.0.0`**: The `version` in `electron/package.json` was never changed from the scaffold default. Version constraints and versioned channels can't distinguish your releases, and the reset on a version change never happens. Bump the version for every release.
- **A `manifest` bundle isn't delivered**: Electron devices only receive `zip` bundles. Upload with the default `zip` artifact type.
- **The app runs an old bundle after a desktop update**: This is expected. The SDK resets to the packaged bundle when the app version changes and picks up the next matching bundle on the following check.
- **Reading the SDK logs**: The SDK logs with a `[LiveUpdate]` prefix to the main process output — the terminal that started `npx cap run @capawesome/capacitor-electron`. Renderer output is available in the Chromium DevTools.
- **Resetting the SDK state**: Quit the app and delete the `capawesome-live-update` directory inside the app's `userData` directory. The app then starts with the packaged bundle and a new device ID.

## Next steps

- [Subscribe to a channel](channel-subscription.md) — choose which channel your desktop app receives updates from.
- [Roll back a release](rollbacks.md) — recover from a bad update.
- [Automate publishing in CI/CD](integrations/index.md) — upload bundles from your pipeline.
