Browse documentation

CreateSwRuntimeOptions

Type. Service worker runtime configuration.

Table of contents

Category

Type

Type import

ts
import type { CreateSwRuntimeOptions } from "valyrian.js/sw";

Public signature

ts
type CreateSwRuntimeOptions = { swUrl?: string; scope?: string; strategy?: "prompt-user" | "auto" | "manual"; runtime?: { isNodeJs?: boolean; navigator?: Navigator | null; window?: Window | null; }; };

Type usage

CreateSwRuntimeOptions configures worker location, scope, update strategy and runtime adapters.

Defaults

Defaults are swUrl "./sw.js", scope "/" and strategy "prompt-user".