@synergonai/push-web 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergonai/push-web",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Synergon Push SDK for browsers. Wraps firebase/messaging and handles registration + event reporting.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://synergon.ai",
@@ -9,9 +9,10 @@
9
9
  * 1. Replace the placeholders in `firebaseConfig` with your project's
10
10
  * Web config from Firebase Console → Project Settings → General →
11
11
  * Your apps → Web → SDK setup and configuration.
12
- * 2. Replace the SYNERGON_API_BASE_URL / SYNERGON_TENANT_ID /
13
- * SYNERGON_PUBLISHABLE_KEY placeholders so background message clicks
14
- * can fire /events/opened.
12
+ * 2. Replace the SYNERGON_API_BASE_URL / SYNERGON_PUBLISHABLE_KEY
13
+ * placeholders so background message clicks can fire /events/opened.
14
+ * (The tenant is derived server-side from the publishable key — no
15
+ * tenant id needed here.)
15
16
  *
16
17
  * Why this lives outside the SDK bundle: browser security requires the
17
18
  * service worker to be served from a same-origin URL, and firebase auto
@@ -41,8 +42,7 @@ const firebaseConfig = {
41
42
  };
42
43
 
43
44
  const SYNERGON_API_BASE_URL = 'REPLACE_ME'; // e.g. https://api.apps.synergon.ai/api
44
- const SYNERGON_TENANT_ID = 'REPLACE_ME';
45
- const SYNERGON_PUBLISHABLE_KEY = 'REPLACE_ME'; // pk_live_...
45
+ const SYNERGON_PUBLISHABLE_KEY = 'REPLACE_ME'; // pk_live_... (identifies your tenant)
46
46
 
47
47
  firebase.initializeApp(firebaseConfig);
48
48
  const messaging = firebase.messaging();
@@ -60,7 +60,6 @@ function reportEvent(messageId, eventType) {
60
60
  keepalive: true,
61
61
  headers: {
62
62
  'Content-Type': 'application/json',
63
- 'X-Tenant-Id': SYNERGON_TENANT_ID,
64
63
  'Authorization': `Bearer ${SYNERGON_PUBLISHABLE_KEY}`,
65
64
  },
66
65
  body: JSON.stringify({