SwoffSwoff

Config Reference

Full schema for swoff.config.json — every field, its type, default, and description.

Configuration Reference

Full schema for swoff.config.json — every field, its type, default, and description.

Quick reference

{
  "$schema": "https://swoff.netlify.app/schema/v1.json",
  "framework": "react",
  "build": {
    "swOutput": "dist",
    "swoffPath": "swoff",
    "swUrl": "/swoff.sw.js"
  },
  "features": {
    "requestBatchWindowMs": 50,
    "connectivity": {
      "enabled": false,
      "heartbeatIntervalMs": 30000
    },
    "pwa": {
      "enabled": false,
      "preventDefaultInstall": false
    },
    "serviceWorker": {
      "autoActivate": false,
      "strategy": {
        "default": "cache-first",
        "patterns": {
          "/api/*": {
            "strategy": "reactive",
            "staleTime": 30,
            "refetchOnFocus": true
          },
          "/static/*": "cache-first"
        },
        "reactive": {
          "staleTime": 0,
          "refetchInterval": 0,
          "refetchOnReconnect": false,
          "refetchOnFocus": false
        },
        "maxRuntimeCacheAge": 2592000,
        "normalizeKey": false,
        "ignoreQueryParams": [],
        "timeout": 10
      },
      "navigation": {
        "mode": "spa",
        "preload": true,
        "fallback": "/index.html",
        "precacheRoutes": [],
        "rules": []
      }
    },
    "refetchQueue": {
      "batchSize": 5,
      "batchDelayMs": 1000,
      "retry": {
        "maxRetries": 3,
        "backoffMs": 1000,
        "maxBackoffMs": 10000,
        "jitterMs": 100
      }
    },
    "mutationQueue": {
      "enabled": false,
      "batchSize": 1,
      "batchDelayMs": 0,
      "retry": {
        "maxRetries": 5,
        "backoffMs": 1000,
        "maxBackoffMs": 30000,
        "jitterMs": 250
      },
      "backgroundSync": false
    },
    "auth": {
      "enabled": false,
      "type": "cookie",
      "routePaths": [
        "/api/login",
        "/api/logout",
        "/api/register",
        "/api/refresh",
        "/api/me"
      ]
    },
    "graphql": {
      "enabled": false,
      "endpoints": ["/graphql"]
    },
    "tagInvalidation": {
      "enabled": false,
      "debounceMs": 0,
      "skipPrefixes": ["api", "v1", "v2", "v3", "rest", "graphql", "gql"],
      "patterns": {},
      "singularization": {},
      "cascading": {}
    },
    "pushNotifications": false,
    "serverPush": {
      "enabled": false,
      "type": "sse",
      "endpoint": "/api/events",
      "reconnectDelayMs": 5000
    }
  }
}

Top-level fields

FieldTypeDefaultDescription
$schemastringJSON Schema URL (for IDE autocomplete)
framework"react" | "nextjs" | "remix" | "tanstack-start-react" | "astro" | "nuxt" | "sveltekit" | "vike" | "vue" | "svelte" | "vanilla" | "no-bundler"auto-detectedYour UI framework. Meta-frameworks auto-configure navigation mode, strategy defaults, and build paths via swoff init.
buildobjectSee Build — output paths, SW filename, registration URL, and precache directory scanning.

On this page