UNPKG

@braze/service-worker

Version:

Braze service worker to be used with the Braze Web SDK.

17 lines (10 loc) 813 B
# Install ```shell $ npm install --save @braze/web-sdk $ npm install --save @braze/service-worker ``` This will install the Braze Service Worker files into `./node_modules/@braze/service-worker` where you can reference them locally. Note that the Braze Service Worker is only meant to be used along with the Braze Web SDK. # Usage In your build process, copy `node_modules/@braze/service-worker/service-worker.js` to your web application's public root directory. Then, using the Web SDK, provide the `serviceWorkerLocation` initialization option with the path to your service worker. See [our documentation pages](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration/) for steps to integrate push notifications into your website using the Braze Web SDK.