Notifications API

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Want more browser support for this feature? Tell us why.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The Notifications API allows web pages to control the display of system notifications to the end user.

Concepts and usage

A web notification is a message box used to inform users when events occur on web apps. Web notifications are rendered by the operating system's native notification system, making them display identically to notifications from any other app on the platform. Because the underlying OS renders web notifications, they are outside the top-level browsing context viewport, and can be shown even when the user has switched tabs or moved to a different app.

Persistent and non-persistent notifications

The Notifications API supports two types of notifications:

  • Non-persistent notifications are created in a browsing context, such as a web page or tab. Their lifetime is tied to the lifetime of the page — if the page is closed, the notification can no longer be interacted with.

    They are created using the Notification() constructor and fire events such as