How can I implement browser popup and sound notifications for assignments and mentions?

I’m working on a Frappe application and would like to enhance the user notification experience.

Currently, when a user is:

  • Assigned a document

  • Mentioned in a comment (@user)

  • Assigned a ToDo

  • Receives a Workflow Action

the notification is visible only in the notification bell (and email if configured). However, I’d like users to receive a browser desktop popup notification and optionally a sound alert while they are actively using Frappe.

My goal is to have functionality similar to applications like Slack or Microsoft Teams, where users immediately see a browser notification (after granting browser permission) instead of having to keep checking the notification bell.

Has anyone implemented something similar?

Specifically, I’d like to know:

  • Is there any built-in support for browser notifications in Frappe?

  • Can this be achieved using frappe.publish_realtime() or another real-time event?

  • Is there a recommended way to integrate the browser’s Notification API with Frappe?

  • Has anyone created a custom app or client script for this feature that they can share?

Any suggestions, implementation examples, or best practices would be greatly appreciated.

Hi @spathakvincular.in

I tried a simple client script and alert() worked so theoretically it should work on your use case: -

frappe.ui.form.on(‘Sales Invoice’, {
refresh(frm) {
alert(“hello world”);
}
})

Hope it helps

Hi @asieftejani, Thank you for your reply I tried doing this using client script but client script runs on a doctype and there is no doctype for these ‘bell notifications’.

Hi @spathakvincular.in

Use the Notification Log Doctype

But I think here you may need a server script to connect to a client script.

Edit: - I thought we could use frappe.msgprint Dialog API but i think its going to be more complicated than that

Best of luck

Thank you for your reply @asieftejani

I tried using ‘Notification Log Doctype’ but it is not working.

Can you please ellaborate a little about ‘Dialog API’. Do I have to use ‘Dialog API’ in custom code?

Hi @spathakvincular.in

Try this GitHub - kid1194/frappe_alerts: Frappe module that displays custom alerts to specific recipients after login. · GitHub

or

Hope it helps