> For the complete documentation index, see [llms.txt](https://pmsgz.gitbook.io/nectar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pmsgz.gitbook.io/nectar/advanced/web-apis/notifications.md).

# Notifications API

## Overview

Notifications API allows web apps to show local notifications to the user that are displayed outside the app at the system level, even if the app is idle or in the background.

Notifications API is not meant for Push notifications, which requires server. For Push notifications, you can check Firebase and OneSignal integrations.

## Demo

<https://nectar.website/demo/web-apis/notifications/>

## Usage

You can refer to the code present in `/partials/web-apis/notifications.html` file and use it accordingly.

{% hint style="info" %}
Using Notifications API requires Service Worker.
{% endhint %}

The code for handling notifications in present in `/www/service-worker.js` file, which you can modify as per your needs.

## Reference

<https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API>\
<https://web-push-book.gauntface.com/demos/notification-examples>
