@cloudsignal/pwa-sdk 1.2.4 → 2.1.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 +24 -22
- package/README.md +45 -509
- package/dist/{chunk-IMM7VF4N.js → chunk-IQHSODT4.js} +6 -6
- package/dist/chunk-IQHSODT4.js.map +1 -0
- package/dist/hmac-WITZIX2O.js +3 -0
- package/dist/{hmac-LWLR6F7Z.js.map → hmac-WITZIX2O.js.map} +1 -1
- package/dist/index.cjs +77 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +31 -35
- package/dist/index.d.ts +31 -35
- package/dist/index.global.js +6 -6
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +76 -85
- package/dist/index.js.map +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-IMM7VF4N.js.map +0 -1
- package/dist/hmac-LWLR6F7Z.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,37 +5,39 @@ 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.
|
|
8
|
+
## [2.1.0] - 2026-04-23
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
-
- **Auto
|
|
13
|
-
- `registerInstallation()` method for manual
|
|
14
|
-
- `
|
|
15
|
-
- `
|
|
16
|
-
- `install:registered` event emitted when installation is registered with backend
|
|
17
|
-
- Installation tracking works with both HMAC (anonymous) and JWT (authenticated) modes
|
|
12
|
+
- **Auto-register PWA installations on `initialize()`** — when the SDK detects it is running in standalone / installed mode, it automatically POSTs to `/api/v1/registration/install-only` so the device shows up in the Clients tab without requiring the user to enable push first. A subsequent `registerForPush()` call upgrades the same row server-side (matched by browser fingerprint).
|
|
13
|
+
- `registerInstallation()` public method on `CloudSignalPWA` for manual install tracking.
|
|
14
|
+
- `install:registered` event fires after the backend acknowledges the install registration. Payload: `{ registrationId }`.
|
|
15
|
+
- Installation registrations are guarded by a localStorage flag (`isInstallationRegistered` / `markInstallationRegistered`) so repeat `initialize()` calls within the same storage session are no-ops.
|
|
18
16
|
|
|
19
|
-
###
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Restores the auto-install-registration feature originally shipped in 1.2.3 that was inadvertently removed in commit `42935abf`.
|
|
20
|
+
|
|
21
|
+
## [2.0.0] - 2026-04-23
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
- Prevents duplicate registrations using localStorage tracking
|
|
23
|
+
### Changed (BREAKING)
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
- 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.
|
|
26
|
+
- Companion env var (dashboard snippets + docs): `NEXT_PUBLIC_CLOUDSIGNAL_SECRET` → `NEXT_PUBLIC_CLOUDSIGNAL_PUBLISHABLE_KEY`.
|
|
27
|
+
- Error messages and JSDoc updated to reflect the new name.
|
|
25
28
|
|
|
26
|
-
|
|
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
|
|
29
|
+
### Migration
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
```diff
|
|
32
|
+
new CloudSignalPWA({
|
|
33
|
+
organizationId: '...',
|
|
34
|
+
- organizationSecret: 'pk_...',
|
|
35
|
+
+ organizationPublishableKey: 'pk_...',
|
|
36
|
+
serviceId: '...',
|
|
37
|
+
})
|
|
38
|
+
```
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
- Installation registrations include `auth_method`, `auth_provider`, and `idp_user_id` for JWT mode
|
|
40
|
+
JWT mode (`userToken`) is unaffected. Wire protocol (`X-CloudSignal-*` headers) and signing algorithm are unchanged — servers need no update.
|
|
39
41
|
|
|
40
42
|
## [1.2.0] - 2025-01-17
|
|
41
43
|
|