@cloudsignal/pwa-sdk 1.2.4 → 2.0.0

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 CHANGED
@@ -5,37 +5,26 @@ 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.3] - 2026-01-19
8
+ ## [2.0.0] - 2026-04-23
9
9
 
10
- ### Added
11
-
12
- - **Auto Installation Tracking** - Automatically registers PWA installations with the backend when detected
13
- - `registerInstallation()` method for manual installation tracking without push subscription
14
- - `isInstallationRegistered()` method to check if installation is already tracked
15
- - `getInstallationId()` method to get stored installation registration ID
16
- - `install:registered` event emitted when installation is registered with backend
17
- - Installation tracking works with both HMAC (anonymous) and JWT (authenticated) modes
18
-
19
- ### Changed
20
-
21
- - `initialize()` now auto-calls `registerInstallation()` when PWA is detected as installed
22
- - Prevents duplicate registrations using localStorage tracking
10
+ ### Changed (BREAKING)
23
11
 
24
- ### Documentation
12
+ - Renamed the HMAC-mode config field `organizationSecret` → `organizationPublishableKey`. The value has always been an organization publishable key (`pk_*`), safe to ship in browser code; the previous name was misleading and invited customers to paste `sk_*` server-only keys by mistake.
13
+ - Companion env var (dashboard snippets + docs): `NEXT_PUBLIC_CLOUDSIGNAL_SECRET` → `NEXT_PUBLIC_CLOUDSIGNAL_PUBLISHABLE_KEY`.
14
+ - Error messages and JSDoc updated to reflect the new name.
25
15
 
26
- - **Type Corrections**: Fixed `registration.registrationId`, `InstallationState` object type, `queueOfflineRequest` signature, `processOfflineQueue` return type
27
- - **Prerequisites Section**: Added environment variable configuration guide
28
- - **Service Worker Setup**: Added root placement guidance, scope configuration, Workbox/Serwist coexistence patterns
29
- - **Framework Integrations**: Added Next.js App Router guide with dynamic imports, Supabase Auth integration
30
- - **Event Documentation**: Complete event list with handler signatures
31
- - **Troubleshooting**: Service worker, permission, iOS, and token/auth issues
32
- - **Production Checklist**: Pre-deployment verification steps
33
- - **Migration Guides**: From Firebase Cloud Messaging and OneSignal
16
+ ### Migration
34
17
 
35
- ### Backend Support
18
+ ```diff
19
+ new CloudSignalPWA({
20
+ organizationId: '...',
21
+ - organizationSecret: 'pk_...',
22
+ + organizationPublishableKey: 'pk_...',
23
+ serviceId: '...',
24
+ })
25
+ ```
36
26
 
37
- - `/api/v1/registration/install-only` endpoint now supports JWT authentication
38
- - Installation registrations include `auth_method`, `auth_provider`, and `idp_user_id` for JWT mode
27
+ JWT mode (`userToken`) is unaffected. Wire protocol (`X-CloudSignal-*` headers) and signing algorithm are unchanged — servers need no update.
39
28
 
40
29
  ## [1.2.0] - 2025-01-17
41
30