Photo of David Winter

david winter

Simple Electron automatic updates

For my note-taking application, nimblenote, I was looking for the simplest way to handle automatic updates for the user. I was keen to be in a position whereby when I publish new versions of the app that its users were onboarded to that new version as quickly as possible. Ensuring people aren’t stuck on old versions of your app is essential, especially when it comes to fixing any bugs, and dealing with support issues.

I use the amazing electron-builder package, which handles the packaging and publishing of nimblenote. It offers a simple auto-update mechanism via electron-updater, however, it uses your operating-system based notifications which are often missed when they appear, or sometimes snoozed or disabled entirely.

Operating system notifications weren’t going to cut it for me. I wanted to be able to present a dialog box which would allow the user to easily relaunch and update the application with one button click. Although electron-updater does offer all you need to do this via an extendable API, it was going to result in around 100 lines of code to achieve what I wanted—and also—that wasn’t going to be easy to reuse, unless… I packaged up the functionality into a package!

Introducing electron-auto-update, which I’m very pleased has had almost 1,000 downloads in its first week!

This package works in tandem with electron-builder, which I highly recommend for packaging and publishing your application.

Install via either yarn add electron-auto-update or npm add electron-auto-update and then use in your application with:

const {autoUpdate} = require('electron-auto-update');


This will automatically check for updates every hour, and if available, present a simple dialog:

electron-auto-update screenshot

The user can choose to be reminded later, or opt-out of any subsequent reminders if they choose. The check frequency for updates can also be configured, along with also passing through a logger object.

Head on over to the project on GitHub for the full README, and if you find electron-auto-update useful in your projects, please consider sponsoring me on GitHub ♥.