Lesson 7 of 28
javascriptSystem Notifications
8 mins
Course progress25%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 7 of 28
javascript8 mins
Keep these ideas in mind as you work through the lesson.
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.