# hubspot/offline

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hubspot-offline).**

8,584 stars · 824 forks · CSS · MIT · archived

## Links

- GitHub: https://github.com/HubSpot/offline
- Homepage: http://github.hubspot.com/offline/docs/welcome
- awesome-repositories: https://awesome-repositories.com/repository/hubspot-offline.md

## Description

Offline is a JavaScript library that provides an offline-first framework for web applications, centered on monitoring network connectivity and managing the application's response to connection state changes. It detects transitions between online and offline states by listening to browser events and emits custom events that allow other parts of the application to react accordingly.

The library distinguishes itself by combining event-driven connectivity detection with automatic request queuing and retry. When a request fails due to lost connectivity, it is captured and queued in memory, then automatically replayed in order once the network connection is restored. It also includes periodic connectivity probing, which sends lightweight HTTP requests to a known endpoint to verify actual network reachability beyond the browser's own event signals.

Offline provides a visual status indicator that automatically updates to reflect the current online or offline state, and its custom event bus enables decoupled components to respond to connection up, down, and reconnection attempts. The library's documentation covers installation and integration for adding these capabilities to web applications.

## Tags

### Web Development

- [Offline-First Web Apps](https://awesome-repositories.com/f/web-development/offline-first-web-apps.md) — Provides tools for handling network interruptions in web applications as an offline-first JavaScript library.
- [Network Connectivity Monitoring](https://awesome-repositories.com/f/web-development/network-connectivity-monitoring.md) — Detects and reports changes in browser online and offline status to applications.

### Part of an Awesome List

- [Network State Emitters](https://awesome-repositories.com/f/awesome-lists/devtools/event-emitters/network-state-emitters.md) — Fires custom events when the browser transitions between online and offline states.

### DevOps & Infrastructure

- [Request Retries](https://awesome-repositories.com/f/devops-infrastructure/api-service-management/api-resilience/request-retries.md) — Automatically retries AJAX requests that fail due to lost connectivity upon reconnection. ([source](https://cdn.jsdelivr.net/gh/hubspot/offline@master/README.md))
- [Bulk Retry on Reconnect](https://awesome-repositories.com/f/devops-infrastructure/api-service-management/api-resilience/request-retries/automatic-retry-clients/bulk-retry-on-reconnect.md) — Bulk-retries all queued failed requests immediately upon detecting a transition from offline to online.

### Networking & Communication

- [Connection Lifecycle Events](https://awesome-repositories.com/f/networking-communication/connection-lifecycle-events.md) — Binds custom event handlers to online, offline, and reconnection lifecycle events. ([source](https://cdn.jsdelivr.net/gh/hubspot/offline@master/README.md))
- [Endpoint Reachability Probes](https://awesome-repositories.com/f/networking-communication/proxy-connectivity-testing/endpoint-reachability-probes.md) — Checking current connectivity by sending test requests to a resource and evaluating the response. ([source](https://cdn.jsdelivr.net/gh/hubspot/offline@master/README.md))

### Software Engineering & Architecture

- [Event Handling](https://awesome-repositories.com/f/software-engineering-architecture/event-handling.md) — Fires custom events when network state changes for implementing custom offline/online behaviors.
- [Event Bus Architectures](https://awesome-repositories.com/f/software-engineering-architecture/event-bus-architectures.md) — Emits named events for connection up, down, and reconnection attempts for decoupled components.

### System Administration & Monitoring

- [Offline Request Queues](https://awesome-repositories.com/f/system-administration-monitoring/background-job-queues/offline-request-queues.md) — Queues AJAX requests made while offline and resends them when the connection is restored. ([source](http://github.hubspot.com/offline/docs/welcome/))
- [Connectivity Verification Probes](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/operational-health-alerting/health-monitoring-endpoints/http-health-probes/http-endpoint-probes/connectivity-verification-probes.md) — Periodically sends a lightweight HTTP request to a known endpoint to verify actual network reachability beyond browser event signals.
- [Connection Status Indicators](https://awesome-repositories.com/f/system-administration-monitoring/connection-status-indicators.md) — Displays a visual indicator that updates automatically to reflect the current online or offline state. ([source](https://cdn.jsdelivr.net/gh/hubspot/offline@master/README.md))

### User Interface & Experience

- [Network Connectivity Event Dispatchers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/input-event-dispatchers/application-event-dispatching/network-connectivity-event-dispatchers.md) — Detects network state changes by listening to browser online and offline events and dispatching custom events for application-level handling.
- [Visual Status Indicators](https://awesome-repositories.com/f/user-interface-experience/visual-status-indicators.md) — Shows an automatic visual cue that reflects the current network state without manual user intervention.
- [Network Status Indicators](https://awesome-repositories.com/f/user-interface-experience/visual-status-indicators/focus-state-indicators/network-status-indicators.md) — Renders a persistent UI element that reflects the current online or offline status, updating automatically on state transitions.
