Lesson 7 of 28 · javascript
System Notifications
Duration: 8 mins
System Notifications
Electron provides the Notification API (same as the browser) but works in the main process and can show native OS notifications.
function notify(title, body){
new Notification({ title, body }).show();
}
notify('Download complete', 'Your file has been saved to ~/Downloads');
On macOS you can add actions (buttons) and on Windows you can set urgency.
If you need richer notifications (progress bar, images) use the electron-notify or node-notifier libraries.