---
description: Build, run, and package desktop apps for macOS, Windows, and Linux with Electron using the same Capacitor workflow as on iOS and Android.
title: Capacitor Electron Platform for Desktop Apps - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/electron.png
---

<!doctype html> 

[Skip to content ](#capacitor-electron-platform) 

[🖥️ Introducing the **Capacitor Electron Platform** — build desktop apps for macOS, Windows, and Linux. Free & open source. ](/blog/announcing-the-capacitor-electron-platform/) 

* [ SDKs ](/docs/sdks/)
* [ Migration ](#migration)
* [ Plugin Development ](#plugin-development)
* [ Packaging ](#packaging)
* [ Electron Support Policy ](#electron-support-policy)
* [ Limitations ](#limitations)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)
* [ Exif ](/docs/sdks/capacitor/exif/)
* [ Facebook Sign-In ](/docs/sdks/capacitor/facebook-sign-in/)
* [ File Compressor ](/docs/sdks/capacitor/file-compressor/)
* [ File Opener ](/docs/sdks/capacitor/file-opener/)
* [ File Picker ](/docs/sdks/capacitor/file-picker/)
* [ Firebase ](/docs/sdks/capacitor/firebase/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Intercom ](/docs/sdks/capacitor/intercom/)
* [ Intune ](/docs/sdks/capacitor/intune/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Tauri ](/docs/sdks/capacitor/tauri/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ YouTube Player ](/docs/sdks/capacitor/youtube-player/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ Migration ](#migration)
* [ Plugin Development ](#plugin-development)
* [ Packaging ](#packaging)
* [ Electron Support Policy ](#electron-support-policy)
* [ Limitations ](#limitations)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ License ](#license)

# Capacitor Electron Platform[¶](#capacitor-electron-platform "Permanent link")

Capacitor platform to build, run, and package desktop apps for macOS, Windows, and Linux with Electron.[1](#fn:1)

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png?t=1) ](https://capawesome.io/) 

## Features[¶](#features "Permanent link")

The Capacitor Electron platform brings your web app and your Capacitor plugins to the desktop. Here are some of the key features:

* 🖥️ **Cross-platform**: Build desktop apps for macOS, Windows, and Linux from one codebase.
* ⚡ **Familiar workflow**: `cap add`, `cap sync`, `cap run` — the same commands as iOS and Android.
* 🔌 **Plugin support**: Capacitor plugins with an Electron implementation work out of the box; plugins with a web implementation work automatically via fallback.
* 🔒 **Security-first**: Sandboxed renderer, context isolation, strict Content-Security-Policy, and validated IPC — enabled by default and not configurable.
* 🔗 **Deep links**: Custom URL schemes delivered through the standard `@capacitor/app` plugin's `appUrlOpen` event.
* 📱 **App lifecycle**: `appStateChange`, `pause`, and `resume` events, exactly like on mobile.
* ♻️ **Live reload**: Develop against your web dev server with full HMR.
* 📦 **Packaging**: Create installers with electron-builder, including automatic dependency vendoring.
* 🪟 **Window management**: Typed window options, state persistence, and hooks for trays and menus.
* 🧩 **Minimal scaffold**: You own a handful of small, stable files; all platform logic ships in the package and updates via `npm update`.
* 🔁 **Up-to-date**: Always supports the latest Capacitor and Electron versions.
* ⭐️ **Support**: Priority support from the Capawesome Team.
* ✨ **Handcrafted**: Built from the ground up with care and expertise, not forked or AI-generated.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-electron/issues) and we'll take a look!

## Use Cases[¶](#use-cases "Permanent link")

The Electron platform is typically used to bring an existing Capacitor app to the desktop, for example:

* **Desktop companion apps**: Ship your mobile app's functionality to macOS, Windows, and Linux without a rewrite.
* **Offline-first desktop tools**: Combine the platform with plugins like [SQLite](https://capawesome.io/docs/sdks/capacitor/sqlite/) for fully offline desktop applications.
* **Internal business tools**: Distribute apps directly to your team without app stores.
* **Kiosk and point-of-sale apps**: Run your web app full screen on dedicated desktop hardware.
* **Deep-link driven workflows**: Handle custom URL schemes on the desktop exactly like on mobile.

## Compatibility[¶](#compatibility "Permanent link")

| Platform Version | Capacitor Version | Electron Version | Status         |
| ---------------- | ----------------- | ---------------- | -------------- |
| 0.x              | \>=6.x.x          | \>=28.x.x        | Active support |

> \[!NOTE\] On Capacitor 6 and 7, the Capacitor CLI ignores the exit code of platform hooks, so a failing `npx cap sync` still reports success — check the log output for `[capacitor-electron]` errors. Capacitor 8 fails the command properly.

## Guides[¶](#guides "Permanent link")

* [Capacitor Electron Platform: Build Desktop Apps](https://capawesome.io/blog/announcing-the-capacitor-electron-platform/)

## Supported Plugins[¶](#supported-plugins "Permanent link")

Plugins integrate with the Electron platform in one of three ways:

| Plugin                                                                                 | Support                                                                                                                      |
| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [@capacitor/app](https://capacitorjs.com/docs/apis/app)                                | ✅ Built into the platform (appUrlOpen, appStateChange, pause, resume, getInfo, getState, getLaunchUrl, exitApp, minimizeApp) |
| [@capawesome-team/capacitor-sqlite](https://capawesome.io/docs/sdks/capacitor/sqlite/) | ✅ Native Electron implementation via node:sqlite                                                                             |
| Plugins with a web implementation                                                      | ✅ Automatic web fallback                                                                                                     |

Plugins that require native functionality beyond their web implementation need a dedicated Electron implementation (see [Plugin Development](#plugin-development)). Is your favorite plugin missing? Just [open an issue](https://github.com/capawesome-team/capacitor-electron/issues) and we'll take a look!

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to add the platform. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-platforms
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1)Use the `capacitor-platforms` skill from `capawesome-team/skills` to add the `@capawesome/capacitor-electron` platform to my project.
 ``

If you prefer **Manual Setup**, add the platform by running the following commands:

`[](#%5F%5Fcodelineno-2-1)npm install @capawesome/capacitor-electron
[](#%5F%5Fcodelineno-2-2)npx cap add @capawesome/capacitor-electron
[](#%5F%5Fcodelineno-2-3)cd electron && npm install && cd ..
`

We recommend adding a `postinstall` script to your root `package.json` so the Electron dependencies are always installed together with your app dependencies:

`[](#%5F%5Fcodelineno-3-1){
[](#%5F%5Fcodelineno-3-2)  "scripts": {
[](#%5F%5Fcodelineno-3-3)    "postinstall": "cd electron && npm ci && cd .."
[](#%5F%5Fcodelineno-3-4)  }
[](#%5F%5Fcodelineno-3-5)}
`

The initial `cd electron && npm install` generates `electron/package-lock.json` — commit it so that `npm ci` works for every future install.

> \[!NOTE\] Always use the full package name with Capacitor CLI commands (e.g. `npx cap sync @capawesome/capacitor-electron`). A bare `npx cap sync electron` resolves to the `electron` npm package and silently does nothing.

The scaffolded `electron/` project contains only files you own:

| File                         | Purpose                                                 |
| ---------------------------- | ------------------------------------------------------- |
| main.ts                      | \~5 lines: imports the runtime and starts the app       |
| capacitor.electron.config.ts | Typed platform options (window, CSP, deep links, hooks) |
| electron-builder.config.js   | Packaging configuration                                 |
| assets/                      | App icons                                               |

Everything with logic lives in the versioned npm package and updates via `npm update` — your platform project never rots.

## Configuration[¶](#configuration "Permanent link")

Platform options are configured in `electron/capacitor.electron.config.ts` with full type safety:

`[](#%5F%5Fcodelineno-4-1)import { defineConfig } from '@capawesome/capacitor-electron/config';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)export default defineConfig({
[](#%5F%5Fcodelineno-4-4)  window: {
[](#%5F%5Fcodelineno-4-5)    width: 1200,
[](#%5F%5Fcodelineno-4-6)    height: 800,
[](#%5F%5Fcodelineno-4-7)    minWidth: 800,
[](#%5F%5Fcodelineno-4-8)    minHeight: 600,
[](#%5F%5Fcodelineno-4-9)  },
[](#%5F%5Fcodelineno-4-10)  deepLinks: {
[](#%5F%5Fcodelineno-4-11)    scheme: 'myapp',
[](#%5F%5Fcodelineno-4-12)  },
[](#%5F%5Fcodelineno-4-13)});
`

Extension happens through typed options and hooks (`windowFactory`, `beforeReady`, `onWindowCreated`, CSP overrides) — never by owning runtime code.

## Demo[¶](#demo "Permanent link")

A working example can be found here: [capawesome-team/capacitor-electron](https://github.com/capawesome-team/capacitor-electron/tree/main/example)

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-5-1)# Copy web assets + regenerate the plugin manifest
[](#%5F%5Fcodelineno-5-2)npx cap sync @capawesome/capacitor-electron
[](#%5F%5Fcodelineno-5-3)
[](#%5F%5Fcodelineno-5-4)# Run the app (uses server.url for live reload when configured)
[](#%5F%5Fcodelineno-5-5)npx cap run @capawesome/capacitor-electron
[](#%5F%5Fcodelineno-5-6)
[](#%5F%5Fcodelineno-5-7)# Open the built app
[](#%5F%5Fcodelineno-5-8)npx cap open @capawesome/capacitor-electron
`

### Live Reload[¶](#live-reload "Permanent link")

Set `server.url` in your Capacitor config to your dev server and run the app — the window loads the dev server with full HMR, and the plugin bridge works exactly as in production:

`[](#%5F%5Fcodelineno-6-1)// capacitor.config.ts
[](#%5F%5Fcodelineno-6-2)const config: CapacitorConfig = {
[](#%5F%5Fcodelineno-6-3)  // ...
[](#%5F%5Fcodelineno-6-4)  server: {
[](#%5F%5Fcodelineno-6-5)    url: 'http://localhost:5173',
[](#%5F%5Fcodelineno-6-6)  },
[](#%5F%5Fcodelineno-6-7)};
`

`[](#%5F%5Fcodelineno-7-1)npx vite &                                       # your web dev server
[](#%5F%5Fcodelineno-7-2)npx cap run @capawesome/capacitor-electron       # dev mode
`

In dev mode a documented, dev-only CSP relaxation is applied (inline scripts, eval, websockets — required by HMR runtimes), and the window automatically reconnects when the dev server restarts. Remove `server.url` (or use a production config) to serve the built web assets from the app bundle again.

### Deep Links[¶](#deep-links "Permanent link")

Declare the custom URL scheme in the platform configuration (see [Configuration](#configuration)) and listen to the standard `@capacitor/app` event:

`[](#%5F%5Fcodelineno-8-1)import { App } from '@capacitor/app';
[](#%5F%5Fcodelineno-8-2)
[](#%5F%5Fcodelineno-8-3)await App.addListener('appUrlOpen', ({ url }) => {
[](#%5F%5Fcodelineno-8-4)  console.log('App opened with URL:', url);
[](#%5F%5Fcodelineno-8-5)});
`

Deep links opened while the app is running are routed to the running instance (single instance is enforced by default); the URL that launched the app is available via `App.getLaunchUrl()`.

### Debugging[¶](#debugging "Permanent link")

The platform keeps Electron's default application menu, so the Chromium DevTools can be opened at any time via _View → Toggle Developer Tools_ or the keyboard shortcut:

| Operating System | Shortcut           |
| ---------------- | ------------------ |
| macOS            | Cmd \+ Option \+ I |
| Windows          | Ctrl \+ Shift \+ I |
| Linux            | Ctrl \+ Shift \+ I |

To open the DevTools automatically on launch (e.g. to catch logs from early app startup), use the `onWindowCreated` hook in `electron/capacitor.electron.config.ts`:

`[](#%5F%5Fcodelineno-9-1)import { defineConfig } from '@capawesome/capacitor-electron/config';
[](#%5F%5Fcodelineno-9-2)
[](#%5F%5Fcodelineno-9-3)export default defineConfig({
[](#%5F%5Fcodelineno-9-4)  // ...
[](#%5F%5Fcodelineno-9-5)  hooks: {
[](#%5F%5Fcodelineno-9-6)    onWindowCreated: window => {
[](#%5F%5Fcodelineno-9-7)      window.webContents.openDevTools();
[](#%5F%5Fcodelineno-9-8)    },
[](#%5F%5Fcodelineno-9-9)  },
[](#%5F%5Fcodelineno-9-10)});
`

## Migration[¶](#migration "Permanent link")

You can use our **AI-Assisted Migration** to migrate from [@capacitor-community/electron](https://github.com/capacitor-community/electron). Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-10-1)npx skills add capawesome-team/skills --skill capacitor-platforms
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-11-1)Use the `capacitor-platforms` skill from `capawesome-team/skills` to migrate my project from `@capacitor-community/electron` to `@capawesome/capacitor-electron`.
 ``

If you prefer **Manual Migration**, perform the following steps:

1. Back up anything you customized in your existing `electron/` directory (icons, electron-builder configuration, and any code you added to the generated runtime files).
2. Remove the old platform and its `electron/` directory:  
`[](#%5F%5Fcodelineno-12-1)npm uninstall @capacitor-community/electron  
[](#%5F%5Fcodelineno-12-2)rm -rf electron  
`
3. Add this platform:  
`[](#%5F%5Fcodelineno-13-1)npm install @capawesome/capacitor-electron  
[](#%5F%5Fcodelineno-13-2)npx cap add @capawesome/capacitor-electron  
[](#%5F%5Fcodelineno-13-3)cd electron && npm install && cd ..  
`
4. Re-apply your customizations through the typed options in `electron/capacitor.electron.config.ts` (window options, deep-link scheme, CSP overrides, tray/menu via hooks) instead of editing runtime code, and restore your icons to `electron/assets/` and your electron-builder settings in `electron/electron-builder.config.js`.
5. Sync and run (always with the full package name):  
`[](#%5F%5Fcodelineno-14-1)npx cap sync @capawesome/capacitor-electron  
[](#%5F%5Fcodelineno-14-2)npx cap run @capawesome/capacitor-electron  
`

Notes:

* Deep links no longer require hand-written runtime code — declare the scheme in the platform config and listen to `@capacitor/app`'s `appUrlOpen` event.
* Plugins must provide an electron implementation for this platform's contract (see [Plugin Development](#plugin-development)); implementations written for the old platform are not loaded. Plugins whose web implementation is sufficient continue to work unchanged via the automatic fallback.

## Plugin Development[¶](#plugin-development "Permanent link")

Plugins declare their electron implementation via `package.json`:

`[](#%5F%5Fcodelineno-15-1){
[](#%5F%5Fcodelineno-15-2)  "capacitor": {
[](#%5F%5Fcodelineno-15-3)    "electron": { "src": "electron" }
[](#%5F%5Fcodelineno-15-4)  }
[](#%5F%5Fcodelineno-15-5)}
`

The implementation is an ES module at `<src>/dist/plugin.mjs` exporting plugin classes. A plugin class declares its Capacitor registration name and its public API via static metadata — the static property is the contract, so no build-time dependency on this package is required:

`[](#%5F%5Fcodelineno-16-1)class SqliteImpl {
[](#%5F%5Fcodelineno-16-2)  constructor({ config, services, notifyListeners }) { ... }
[](#%5F%5Fcodelineno-16-3)
[](#%5F%5Fcodelineno-16-4)  async open(options) { ... }
[](#%5F%5Fcodelineno-16-5)  async query(options) { ... }
[](#%5F%5Fcodelineno-16-6)
[](#%5F%5Fcodelineno-16-7)  // Not declared below, therefore never bridged.
[](#%5F%5Fcodelineno-16-8)  resolvePath(path) { ... }
[](#%5F%5Fcodelineno-16-9)}
[](#%5F%5Fcodelineno-16-10)
[](#%5F%5Fcodelineno-16-11)// Equivalent: import { defineElectronPlugin } from '@capawesome/capacitor-electron/plugin';
[](#%5F%5Fcodelineno-16-12)SqliteImpl.__capacitorElectronPlugin = {
[](#%5F%5Fcodelineno-16-13)  name: 'Sqlite',
[](#%5F%5Fcodelineno-16-14)  methods: ['open', 'query'],
[](#%5F%5Fcodelineno-16-15)};
[](#%5F%5Fcodelineno-16-16)
[](#%5F%5Fcodelineno-16-17)export { SqliteImpl as Sqlite };
`

The declared `methods` array is the plugin's entire bridged surface: anything not listed stays main-process-internal, and a declared method that is missing on the class fails loudly at boot. Each class is instantiated once in the main process (full Node and Electron API access) and exposed under its registration name through Capacitor's native plugin path — `registerPlugin('Sqlite', { web: ... })` just works, with the web implementation as the automatic fallback for platforms the plugin doesn't cover. No `electron` key in the plugin's `registerPlugin` wiring is needed.

The constructor context provides:

* `config` — the app's Capacitor configuration.
* `notifyListeners(eventName, data)` — emits a plugin event, mirroring Capacitor's native `notifyListeners`. Web listeners use the standard `addListener(eventName, callback)` / `PluginListenerHandle` API.
* `services` — platform primitives (currently `services.bundles`: web-bundle serving, reload, and the failed-boot rollback watchdog).

At sync time the platform statically scans the app's dependencies and generates a plugin manifest — no plugin code runs outside Electron. Results, thrown `Error`s, and their `code` properties cross the bridge with Capacitor semantics.

## Packaging[¶](#packaging "Permanent link")

The scaffolded `electron/` project packages with electron-builder:

`[](#%5F%5Fcodelineno-17-1)cd electron && npm run pack
`

The `pack` script runs three steps: compile (`tsc`), **vendor**, and `electron-builder`. The vendor step (`capacitor-electron vendor`) copies the platform runtime, every plugin's electron implementation, and their dependency closure (production, peer, and installed optional dependencies) into `electron/vendor/`, which the scaffolded electron-builder config maps to `node_modules` inside the packaged app — so module resolution works identically in development (from your app root) and in the package, without a second `npm install` and without version drift.

Code signing, notarization, targets (dmg/msi/nsis/AppImage/deb), and icons are standard electron-builder configuration in the user-owned `electron-builder.config.js` — see https://www.electron.build. Electron Forge is a supported alternative: run `capacitor-electron vendor` before packaging and include `vendor/node_modules` as the app's `node_modules`.

### App Updates[¶](#app-updates "Permanent link")

Two independent update layers, matching mobile:

* **Binary updates** (Electron itself, the runtime, native modules): use [electron-updater](https://www.electron.build/auto-update) — the desktop analog of an app-store update. Wire it in your `main.ts`; it operates on the packaged artifacts produced above.
* **Web-bundle updates**: the platform ships the serving primitive only — `services.bundles` (activate a bundle directory, reload, boot-ready signal, and a failed-boot rollback watchdog that reverts to the previous bundle if the renderer doesn't confirm startup). The OTA update product on top of it (download, channels, verification) is deliberately not part of the platform.

## Electron Support Policy[¶](#electron-support-policy "Permanent link")

* **Floor**: Electron 28 (required for the runtime's serving APIs). No ceiling — the scaffold uses a caret range you control, and the platform releases only when Electron actually breaks an API it uses.
* **Tested**: CI runs the example app against the latest stable Electron and the floor on every release.
* Electron ships a new major roughly every 8 weeks. This platform's wide peer range means you can adopt new Electron majors immediately, without waiting for a platform release.

## Limitations[¶](#limitations "Permanent link")

Read this before committing to the platform — these are inherent trade-offs, not bugs:

* **Binary size and memory.** Every app ships its own Chromium and Node: expect roughly 80–150 MB installed and a matching memory footprint. If minimal footprint is the priority, Electron is the wrong tool.
* **Plugins need an electron implementation.** Only Capacitor plugins that ship an `electron` implementation (or whose web implementation is sufficient — the automatic fallback) work. iOS/Android native code does not translate.
* **Native Node addons are not rebuilt automatically.** If a plugin's electron implementation depends on native Node modules, `capacitor-electron vendor` detects and reports them, but you must rebuild them against Electron's ABI yourself (e.g. `@electron/rebuild`) before packaging.
* **No web-bundle OTA product included.** The platform provides the serving primitive (`services.bundles`) only; update delivery, channels, and verification are a separate product layer.
* **Always pass the platform name to the Capacitor CLI.** A bare `npx cap sync` only processes iOS/Android/web; `npx cap sync electron` resolves to the `electron` npm package and silently does nothing. Use the full package name (see the note under Installation).
* **Desktop is not mobile.** APIs like geolocation permission prompts, status bars, or app-store review flows have no desktop equivalent; plugins whose web implementation assumes a mobile browser may behave differently on desktop Chromium.

## FAQ[¶](#faq "Permanent link")

### Can I use any Capacitor plugin with this platform?[¶](#can-i-use-any-capacitor-plugin-with-this-platform "Permanent link")

Plugins with a dedicated Electron implementation or a sufficient web implementation work (see [Supported Plugins](#supported-plugins)). Plugins that only ship iOS/Android native code do not.

### How do I update Electron in my app?[¶](#how-do-i-update-electron-in-my-app "Permanent link")

Update the `electron` version in `electron/package.json` and run `npm install` there. The platform supports Electron 28 and later with no upper bound.

### Does `Capacitor.getPlatform()` return `electron`?[¶](#does-capacitorgetplatform-return-electron "Permanent link")

Yes. `Capacitor.getPlatform()` returns `'electron'` and `Capacitor.isNativePlatform()` returns `true`, so you can branch platform-specific code the same way as on iOS and Android.

## Related Plugins[¶](#related-plugins "Permanent link")

* [Capacitor SQLite plugin](https://capawesome.io/docs/sdks/capacitor/sqlite/) — local SQL database with a native Electron implementation.

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://capawesome.io/newsletter/).

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-electron/blob/main/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-electron/blob/main/LICENSE).

---

1. This project is not affiliated with, endorsed by, sponsored by, or approved by the OpenJS Foundation or any of its affiliates. `Electron` is a trademark of the OpenJS Foundation. [↩](#fnref:1 "Jump back to footnote 1 in the text")

July 13, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/electron/#article", "headline": "Capacitor Electron Platform for Desktop Apps", "name": "Capacitor Electron Platform for Desktop Apps", "description": "Build, run, and package desktop apps for macOS, Windows, and Linux with Electron using the same Capacitor workflow as on iOS and Android.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/electron/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/electron/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/electron/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/electron/#software", "name": "Capacitor Electron Platform for Desktop Apps", "description": "Build, run, and package desktop apps for macOS, Windows, and Linux with Electron using the same Capacitor workflow as on iOS and Android.", "url": "https://capawesome.io/docs/sdks/capacitor/electron/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Can I use any Capacitor plugin with this platform?", "acceptedAnswer": {"@type": "Answer", "text": "Plugins with a dedicated Electron implementation or a sufficient web implementation work (see Supported Plugins). Plugins that only ship iOS/Android native code do not."}}, {"@type": "Question", "name": "How do I update Electron in my app?", "acceptedAnswer": {"@type": "Answer", "text": "Update the electron version in electron/package.json and run npm install there. The platform supports Electron 28 and later with no upper bound."}}, {"@type": "Question", "name": "Does Capacitor.getPlatform() return electron?", "acceptedAnswer": {"@type": "Answer", "text": "Yes. Capacitor.getPlatform() returns 'electron' and Capacitor.isNativePlatform() returns true, so you can branch platform-specific code the same way as on iOS and Android."}}], "url": "https://capawesome.io/docs/sdks/capacitor/electron/"}
```
