Web Push Notifications

Push Notification is a Web SDK feature you could enable to bring the power of BirdCRM in building connected user experience to your website.

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:

    <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:

    importScripts('https://embeddables.p.mbirdcdn.net/sdk/v0/bird-push-sw.js');
  • Once Bird SDK init we can subscribe to Push Notifications by Bird.pushNotifications.subscribe()

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

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

Last updated

Was this helpful?