Workbox

Google's JavaScript libraries for building service workers and Progressive Web Apps

Library
npm
v7.4.1
13,031 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 88
Maintenance 92
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 86
Code Quality 84
Innovation 70
Learning Curve 72

Workbox is Google’s set of JavaScript libraries and build tools for adding production-grade service-worker behavior to a web app: precaching of build assets, runtime caching strategies (cache-first, network-first, stale-while-revalidate), request routing, background sync for offline form submissions, and broadcast update notifications when cached content changes. workbox-core is the shared module that every other Workbox package depends on for common state, logging, and cache-name configuration, making it the foundational package of the whole workbox-* family.

The monorepo ships both runtime libraries (workbox-precaching, workbox-routing, workbox-strategies, workbox-cacheable-response, workbox-expiration, workbox-background-sync, workbox-window, workbox-streams, workbox-navigation-preload, workbox-google-analytics, workbox-recipes) and build-time tooling (workbox-build, workbox-webpack-plugin, workbox-cli) that generates the service-worker file and precache manifest as part of a project’s build step. It has been the de facto standard for hand-rolled PWA service-worker logic since Google introduced it as the successor to sw-precache/sw-toolbox.

What You Get

  • Precaching (workbox-precaching) of build-time assets with automatic cache versioning based on file content hashes
  • Runtime caching strategies (workbox-strategies): cache-first, network-first, stale-while-revalidate, network-only, cache-only
  • Declarative request routing (workbox-routing) to match URL patterns or request types to specific caching strategies
  • Background sync (workbox-background-sync) for retrying failed POST/PUT requests once connectivity returns
  • Build integrations (workbox-webpack-plugin, workbox-build, workbox-cli) that generate the service worker and precache manifest without hand-writing cache-invalidation logic
  • workbox-window for coordinating service-worker lifecycle events (install, update, activation) from the main page thread

Common Use Cases

  • Adding offline support to a web app by precaching the built JS/CSS/HTML bundle and serving it from cache when the network is unavailable
  • Implementing a stale-while-revalidate strategy for API responses so the UI renders instantly from cache while a fresh copy loads in the background
  • Queuing failed form submissions or API writes via background sync so they retry automatically once the device reconnects
  • Generating a production-ready service worker as part of a webpack, Vite, or custom build pipeline via workbox-build/workbox-webpack-plugin instead of hand-writing cache-invalidation logic

Under The Hood

Architecture - The repository is a Lerna-managed monorepo (lerna.json) under packages/, with workbox-core at the center: it’s imported by nearly every other package for shared logging, cache-name prefixing, and plugin-callback conventions, while workbox-routing and workbox-strategies form the runtime request-handling pipeline (a Router maps matched requests to a Strategy instance, which composes with plugins like workbox-cacheable-response and workbox-expiration). Build-time packages (workbox-build, workbox-webpack-plugin, workbox-cli) are architecturally separate — they statically analyze a project’s build output and emit a generated service-worker file rather than running inside the service worker themselves. Tech Stack - Primarily JavaScript/TypeScript, built and tested via Gulp (gulpfile.js, gulp-tasks/) rather than a single unified bundler config, with ESLint configs split per-language (javascript.eslintrc.js, typescript.eslintrc.js) and Prettier for formatting. The infra/ directory holds shared build infrastructure used across all packages/* members. Code Quality - workbox-core’s own implementation is compact (~1,815 lines), reflecting its role as shared plumbing rather than feature logic; the wider repo has a dedicated test/ directory and CONTRIBUTING.md describing the PR/testing process expected for a Google-maintained web-platform library used across a large fraction of production PWAs. Google’s Aurora and Web DevRel teams are both credited as maintainers, indicating institutional rather than solo-maintainer ownership. API Design - A minimal service worker using Workbox is a handful of declarative calls (precacheAndRoute(self.__WB_MANIFEST), registerRoute(match, strategy)) rather than hand-written fetch event listeners with manual cache management, which is Workbox’s central value proposition — trading the Fetch/Cache API’s low-level flexibility for a much smaller amount of boilerplate to get correct, production-grade caching behavior.

Used by 27 apps in this directory

Go
52%
Apache 2.0

opencloud

File Storage

6,218

Open source file management and collaboration platform that keeps your data under your control, no database required.

View details
86
Repo Health
80
Technical
68
Dependency
Built with
Go 52%
Gherkin 33%
PHP 11%
Updated 6 days ago
TypeScript
96%
Other

Refly

AI Development · Automation · No Code Platforms

7,537

Build deterministic, versioned agent skills from natural language—run them anywhere from Claude Code to Slack.

View details
68
Repo Health
76
Technical
63
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
TypeScript
96%
Other

Refly

AI Development · Automation · No Code Platforms

7,537

Build deterministic, versioned agent skills from natural language—run them anywhere from Claude Code to Slack.

View details
68
Repo Health
76
Technical
63
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
TypeScript
96%
Other

Refly

AI Development · Automation · No Code Platforms

7,537

Build deterministic, versioned agent skills from natural language—run them anywhere from Claude Code to Slack.

View details
68
Repo Health
76
Technical
63
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
TypeScript
96%
Other

Refly

AI Development · Automation · No Code Platforms

7,537

Build deterministic, versioned agent skills from natural language—run them anywhere from Claude Code to Slack.

View details
68
Repo Health
76
Technical
63
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
TypeScript
99%
Other

Rowy

Databases · Low Code Platforms

6,842

Manage Firestore data in an Airtable-like spreadsheet UI and build Cloud Functions workflows directly in your browser—on your own GCP project.

View details
45
Repo Health
71
Technical
65
Dependency
Built with
TypeScript 99%
Updated 1 years ago
Go
66%
AGPL 3.0

Vikunja

Project Management

5,833

Self-hosted task management with natural-language quick-add, multiple views, and a fully documented REST API — your tasks, your infrastructure, zero lock-in.

View details
86
Repo Health
81
Technical
65
Dependency
Built with
Go 66%
TypeScript 24%
Updated 5 days ago
Go
66%
AGPL 3.0

Vikunja

Project Management

5,833

Self-hosted task management with natural-language quick-add, multiple views, and a fully documented REST API — your tasks, your infrastructure, zero lock-in.

View details
86
Repo Health
81
Technical
65
Dependency
Built with
Go 66%
TypeScript 24%
Updated 5 days ago
TypeScript
96%
GPL 3.0

Wire

Collaboration · Team Chat · Video Conferencing

1,192

Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.

View details
93
Repo Health
8
Technical
68
Dependency
Built with
TypeScript 96%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers