Skip to main content

Type Alias: ServiceWorkerConfig

ServiceWorkerConfig = object

Defined in: serviceWorker/config.ts:7

Runtime configuration of the service worker shipped as @ttoss/react-pwa/sw.js.

The app passes it as search params on the registration URL (see buildServiceWorkerUrl), so the same prebuilt file serves every app.

Properties​

badge?​

optional badge?: string

Defined in: serviceWorker/config.ts:41

Notification badge when a push payload has none.


cacheName​

cacheName: string

Defined in: serviceWorker/config.ts:11

Cache name. Change it to drop every entry cached by a previous version.


cachePaths​

cachePaths: string[]

Defined in: serviceWorker/config.ts:21

Same-origin path prefixes served cache-first (icons, manifest, favicon). Every other request goes to the network untouched, so navigations and hashed bundles always reflect the latest deploy.


defaultBody​

defaultBody: string

Defined in: serviceWorker/config.ts:29

Notification body when a push payload has none.


defaultTitle​

defaultTitle: string

Defined in: serviceWorker/config.ts:25

Notification title when a push payload has none.


defaultUrl​

defaultUrl: string

Defined in: serviceWorker/config.ts:33

URL opened when a notification without url is clicked.


icon?​

optional icon?: string

Defined in: serviceWorker/config.ts:37

Notification icon when a push payload has none.


precache​

precache: string[]

Defined in: serviceWorker/config.ts:15

Same-origin paths fetched into the cache on install.