@ethora/chat-component 26.2.18 → 26.2.21

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dappros Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -121,6 +121,8 @@ export default function App() {
121
121
  enabled: true,
122
122
  softAsk: false,
123
123
  vapidPublicKey: 'PLACEHOLDER_VAPID_PUBLIC_KEY',
124
+ iconPath: '/icons/push-icon-192.png',
125
+ badgePath: '/icons/push-badge-72.png',
124
126
  firebaseConfig: {
125
127
  apiKey: 'PLACEHOLDER_API_KEY',
126
128
  authDomain: 'PLACEHOLDER_AUTH_DOMAIN',
@@ -419,6 +421,8 @@ Below is a grouped reference for all `config` options.
419
421
  | `pushNotifications.firebaseConfig` | `FBConfig` | Firebase app config for push messaging. |
420
422
  | `pushNotifications.serviceWorkerPath` | `string` | Service worker path, default `/firebase-messaging-sw.js`. |
421
423
  | `pushNotifications.serviceWorkerScope` | `string` | Service worker scope, default `/`. |
424
+ | `pushNotifications.iconPath` | `string` | Custom icon URL/path for OS push notifications. |
425
+ | `pushNotifications.badgePath` | `string` | Custom badge URL/path for OS push notifications. Falls back to `iconPath`. |
422
426
  | `pushNotifications.softAsk` | `boolean` | Do not immediately trigger browser permission prompt. |
423
427
  | `pushNotifications.onClick` | `(params) => void \| Promise<void>` | Callback invoked when the user clicks an OS push notification (including cold start via URL marker). |
424
428
 
@@ -505,6 +509,8 @@ npx @ethora/chat-component ethora-chat
505
509
  },
506
510
  serviceWorkerPath: '/firebase-messaging-sw.js',
507
511
  serviceWorkerScope: '/',
512
+ iconPath: '/icons/push-icon-192.png',
513
+ badgePath: '/icons/push-badge-72.png',
508
514
  softAsk: false,
509
515
  onClick: async ({ roomJID, messageId, url, data }) => {
510
516
  // Your app-level routing/analytics can live here.
@@ -531,6 +537,8 @@ function PushPermissionButton() {
531
537
  }
532
538
  ```
533
539
 
540
+ `iconPath` and `badgePath` should point to public, reachable assets (for example, files from your app `public/` directory).
541
+
534
542
  ## Auth Strategies
535
543
 
536
544
  | Strategy | Config shape | Best for |
package/dist/config.d.ts CHANGED
@@ -1,6 +1,9 @@
1
- export declare const VITE_APP_API_URL = "https://api.ethoradev.com/v1";
1
+ export declare const VITE_APP_API_URL: string;
2
2
  export declare const VITE_APP_DISABLE_STRICT = "true";
3
- export declare const VITE_APP_DOMAIN_NAME = "ethoradev.com";
4
- export declare const VITE_APP_XMPP_BASEDOMAIN_OLD = "xmpp.ethoradev.com";
5
- export declare const VITE_APP_XMPP_BASEDOMAIN = "xmpp.ethoradev.com";
6
- export declare const SERVICE = "wss://xmpp.ethoradev.com:5443/ws";
3
+ export declare const VITE_APP_DOMAIN_NAME: string;
4
+ export declare const VITE_APP_WEB_DOMAIN: string;
5
+ export declare const VITE_APP_WEB_URL: string;
6
+ export declare const VITE_APP_XMPP_BASEDOMAIN_OLD: string;
7
+ export declare const VITE_APP_XMPP_BASEDOMAIN: string;
8
+ export declare const VITE_APP_XMPP_CONFERENCE: string;
9
+ export declare const SERVICE: string;
@@ -2,9 +2,7 @@ import { default as React, ReactNode } from 'react';
2
2
  import { default as XmppClient } from '../networking/xmppClient';
3
3
  import { IConfig, IRoom, xmppSettingsInterface } from '../types/types';
4
4
  interface XmppContextType {
5
- client: XmppClient | null;
6
- providerBootstrapStatus: 'idle' | 'running' | 'ready' | 'failed';
7
- initMode: 'provider' | 'chat';
5
+ client: XmppClient;
8
6
  setClient: (client: XmppClient | null) => void;
9
7
  initializeClient: (username: string, password: string, xmppSettings?: xmppSettingsInterface, roomsList?: {
10
8
  [jid: string]: IRoom;