PWA SDK

PWA + Push Notifications

MQTT when active, web push when backgrounded. Automatic fallback. Installable PWA with offline queue.

Native-Like Push for the Web

Combine MQTT real-time messaging with web push notifications for a seamless experience across active and backgrounded states.

Smart Transport Switching

MQTT WebSocket when the app is active, web push when backgrounded. Automatic fallback between transports.

PWA Installation

Installable progressive web app with service worker, offline support, and native-like experience on any device.

Offline Queue

Messages queued in IndexedDB when offline. Automatically synced when connectivity returns. No data loss.

JWT Auth Providers

Works with Supabase, Firebase, Auth0, and Clerk. Automatic token refresh and re-authentication.

Smart Fallback

Connect Once, Reach Everywhere

Initialize the SDK, connect to MQTT, and enable push notifications. The SDK handles transport switching, token refresh, and offline queuing automatically.

Device Detection
Automatically detects device capabilities and selects the optimal transport
Battery-Aware Heartbeat
Adjusts MQTT keepalive intervals based on battery status to save power
Screen Wake Lock
Keeps the screen active during critical operations like data sync
Network-Aware
Adapts behavior based on connection type β€” WiFi, cellular, or offline
pwa.js
import { CloudSignalPWA }
from '@cloudsignal/pwa-sdk'
const pwa = new CloudSignalPWA({
authEndpoint: '/api/auth/mqtt',
pushVapidKey: 'your-vapid-key',
onNotification: (msg) => showToast(msg),
onTokenExpired: () => refreshToken(),
})
await pwa.connect()
await pwa.enablePush()

Start Building with PWA + Push

Add smart push notifications and offline support to your web app. Free tier included.