> ~~## How to setup frontend web app too which your visitors will subscribe?
~~
- [ ] **Steps**
1. Add SW.js file to your public folder.
2. Add these code in header app.
`<script>
navigator.serviceWorker.register("sw.js");
function enableNotif() {
Notification.requestPermission().then((permission)=> {
if (permission === 'granted') {
// get service worker
navigator.serviceWorker.ready.then((sw)=> {
// subscribe
sw.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: "these code will generate for you"
}).then((subscription)=> {
console.log(JSON.stringify(subscription));
});
});
}
});
}
</script>`