# Web Push Notifications

Push notification functionality is implemented according to the HTTP Push RFC8030 standard, which is supported by all modern web browsers, including the latest version of Safari.

Integrating Push Notifications with Bird Web SDK into your website consists of the following steps:

* Add `<script>` tag associated with your Bird Application by the **data-config-url** at your website:

  ```html
  <script
    src="https://embeddables.p.mbirdcdn.net/sdk/v0/bird-sdk.js"
    data-config-url="{applications_key_url}"
  ></script>
  ```
* Add `/service-worker.js` file with the following content:

  ```javascript
  importScripts('https://embeddables.p.mbirdcdn.net/sdk/v0/bird-push-sw.js');
  ```

{% hint style="warning" %}
It must be hosted at your website domain like <https://yourwebsite.domain/service-worker.js>

Note: you also could set another filename in the Bird Applications setting if you need to.
{% endhint %}

* Once Bird SDK init we can subscribe to Push Notifications by **Bird.pushNotifications.subscribe()**

{% hint style="warning" %}
You must have your users interact with your site before you are allowed to ask for notification permissions.
{% endhint %}

* Add the subscribe call for example with a button click:

  ```javascript
  subscribeButton.addEventListener('click', async () => {
    await Bird.pushNotifications.subscribe();
  });
  ```
