Feature Map
Every Swoff feature, module-by-module — what it gives you, how to enable it, and how it compares to other libraries.
A single-page map of every Swoff feature. Start with npx @swoff/cli init, pick the features your app needs, and Swoff generates offline infrastructure — service worker, caches, auth, mutations — from your config. Everything here is module-by-module: what it does, how to turn it on, what it depends on, and which libraries solve the same problem.
Start
npx @swoff/cli init
npx @swoff/cli generate
node swoff/sw/generator.mjsinit— writesswoff.config.json.generate— produces theswoff/source modules (fetch, cache, auth, mutation, …).generator.mjs— a build step (added to your build script) that scans built assets and writes the finalsw.js.
Register the service worker in your app entry:
import { initServiceWorker } from "./swoff/client-injector";
initServiceWorker();See the CLI reference and Build config for the full workflow.
Feature map
Two layers. Top-level features (features.*) are independent capabilities. Caching sub-features live under the features.caching umbrella and all activate through it. Solid edges are dependencies; dashed edges carry extra constraints.
Rules the map implies:
- The umbrella gates everything cache-related. Any caching sub-feature needs
features.caching.enabled: true. When it'sfalse, the SW has no fetch listener. - Every sub-feature is opt-in with an explicit
enabled: true— includingtagInvalidation. Itsfetch/core,cache/tags, andcache/invalidatemodules are only generated whenfeatures.caching.tagInvalidation.enabledistrue. - Background sync and server push need cookie auth — they run in the SW scope with no DOM to refresh bearer tokens.
strategy.reactiveis generated only whenstrategy.defaultis"reactive".
Module timeline
How the features stack, top to bottom — each is an accordion you can expand. §6 (the caching umbrella) holds its sub-features as a nested accordion. Click a title to open its details.
Next steps
- Deep library-by-library matrices: Library Comparison
- Config schema for every feature:
Config Reference - All generated APIs:
API Reference - Design rationale and internal mechanics:
Architecture - Per-ecosystem setup: Framework Integration