@interopio/browser-worker
v4.4.0
Published
IO Connect Browser service worker module
Readme
@interopio/browser-worker
Overview
The @interopio/browser-worker library is designed to be imported into the Service Worker file of your Browser Client app. The library enables your io.Connect Browser project to correctly process notification actions and their respective click logic.
Installation
To install the library, execute the following command:
npm install @interopio/browser-workerUsage
The following examples demonstrate basic initialization of the @interopio/browser-worker library in your Service Worker file.
ℹ️ For more details on using the
@interopio/browser-workerlibrary, see the io.Connect Browser official documentation.
Importing the package in a dedicated Service Worker project the output of which will be a ready Service Worker script:
const IOWorker = require("@interopio/browser-worker");
IOWorker();Using the importScripts() function to add the io.Connect Browser Worker to the Service Worker scope. This is suitable for basic Service Worker scripts:
importScripts("/web.worker.umd.js");
self.IOWorker();