@cloudsignal/pwa-sdk 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,74 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.0] - 2025-01-17
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **JWT Authentication** - User-linked registrations via JWT tokens from identity providers
|
|
13
|
+
- **Dual Auth Mode** - Support both HMAC (anonymous) and JWT (authenticated) authentication
|
|
14
|
+
- `userToken` config option for JWT tokens (Supabase, Firebase, Auth0, Clerk, custom OIDC)
|
|
15
|
+
- `onTokenExpired` callback for automatic token refresh on 401 errors
|
|
16
|
+
- `setUserToken()` method to upgrade from anonymous to authenticated registration
|
|
17
|
+
- `getAuthMode()` method to check current auth mode ('hmac' | 'jwt')
|
|
18
|
+
- `auth:tokenUpdated` event emitted when auth token is updated/upgraded
|
|
19
|
+
- Full TypeScript types for JWT auth utilities
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- All API calls now support both HMAC signature and JWT Bearer token authentication
|
|
24
|
+
- Registration API extracts user_id and user_email from JWT claims when in JWT mode
|
|
25
|
+
|
|
26
|
+
### Use Case
|
|
27
|
+
|
|
28
|
+
Enables smart notification routing - send in-app notifications when users are online (MQTT connected) and web push when offline by linking registrations to authenticated user identities.
|
|
29
|
+
|
|
30
|
+
## [1.1.1] - 2025-01-17
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **Vitest Test Framework** - Comprehensive unit test suite with jsdom environment
|
|
35
|
+
- **DeviceDetector Tests** - 16 tests covering device/browser/OS detection
|
|
36
|
+
- **WakeLockManager Tests** - 16 tests covering screen wake lock functionality
|
|
37
|
+
- **i18n Translation Tests** - 18 tests covering all 20 supported languages
|
|
38
|
+
- **Fingerprint Tests** - 7 tests covering unique device fingerprint generation
|
|
39
|
+
- `test:coverage` script for code coverage reporting
|
|
40
|
+
- Total: 57 unit tests passing
|
|
41
|
+
|
|
42
|
+
## [1.1.0] - 2025-01-17
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- **Screen Wake Lock** - Prevent screen sleep during critical operations (WakeLockManager)
|
|
47
|
+
- **Offline Request Queue** - IndexedDB-backed queue with exponential backoff retry (OfflineQueueManager)
|
|
48
|
+
- **iOS Install Banner** - Beautiful modal guiding iOS Safari users to install (IOSInstallBanner)
|
|
49
|
+
- **20-Language i18n** - Auto-detects browser language for iOS banner
|
|
50
|
+
- Supported: en, es, fr, de, it, pt, nl, ru, zh, ja, ko, ar, he, hi, tr, pl, sv, da, no, fi
|
|
51
|
+
- **Network-Aware Heartbeat** - Auto-adjusts interval based on connection type (4G=30s, 3G=60s, 2G=120s)
|
|
52
|
+
- **Battery-Aware Heartbeat** - Pauses heartbeat when battery <15% and not charging
|
|
53
|
+
- **Notification Analytics** - Track displayed/clicked/dismissed events in service worker
|
|
54
|
+
- **Save Data Respect** - Reduces heartbeat frequency when user has Save Data enabled
|
|
55
|
+
|
|
56
|
+
### New Config Options
|
|
57
|
+
|
|
58
|
+
- `wakeLock` - Screen wake lock configuration
|
|
59
|
+
- `offlineQueue` - Offline request queue settings
|
|
60
|
+
- `iosInstallBanner` - iOS install banner customization
|
|
61
|
+
- `notificationAnalytics` - Analytics tracking settings
|
|
62
|
+
|
|
63
|
+
### New Events
|
|
64
|
+
|
|
65
|
+
- `wakeLock:acquired`, `wakeLock:released`, `wakeLock:error`
|
|
66
|
+
- `offlineQueue:queued`, `offlineQueue:processed`, `offlineQueue:flushed`
|
|
67
|
+
- `iosBanner:shown`, `iosBanner:dismissed`, `iosBanner:installClicked`
|
|
68
|
+
- `heartbeat:intervalChanged`, `heartbeat:pausedForBattery`, `heartbeat:resumedFromBattery`
|
|
69
|
+
|
|
70
|
+
### Browser Support Notes
|
|
71
|
+
|
|
72
|
+
- Wake Lock: All modern browsers as of March 2025
|
|
73
|
+
- Battery API: Chromium-based browsers only
|
|
74
|
+
- Network Information API: Chromium-based browsers (graceful fallback)
|
|
75
|
+
|
|
8
76
|
## [1.0.0] - 2025-01-14
|
|
9
77
|
|
|
10
78
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudsignal/pwa-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "CloudSignal PWA SDK - Progressive Web App features with push notifications, JWT/HMAC authentication, installation management, device tracking, offline queue, wake lock, and notification analytics",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|