@connectycube/chat-widget 0.35.0 → 0.36.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.
@@ -1,8 +1,8 @@
1
1
  import { Config } from 'connectycube/types';
2
2
  import { AppPresets } from './hooks/useAppPresets';
3
3
  export type AppProps = AppPresets & {
4
- appId: Config.Credentials['appId'];
5
- authKey: Config.Credentials['authKey'];
4
+ appId: number | string;
5
+ authKey: string;
6
6
  config?: Config.Options;
7
7
  userId?: string;
8
8
  userName?: string;
@@ -1,3 +1,5 @@
1
+ export { default } from './App';
2
+ export type { AppProps as ConnectyCubeChatWidgetProps } from './App';
1
3
  export type ChatWidgetInWindow = {
2
4
  initialNotification?: MessageEvent['data'];
3
5
  open?: () => void;
@@ -7,4 +9,3 @@ export type ChatWidgetInWindow = {
7
9
  export type WindowWithChatWidget = Window & typeof globalThis & {
8
10
  ConnectyCubeChatWidget?: ChatWidgetInWindow;
9
11
  };
10
- export { default } from './App';
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@connectycube/chat-widget",
3
- "description": "A React component that seamlessly integrates ConnectyCube's real-time chat capabilities into your web applications. This widget offers an out-of-the-box solution for embedding chat features—such as instant messaging, user presence, and file sharing—without the overhead of building a complete chat system from scratch.",
4
- "version": "0.35.0",
3
+ "description": "A customizable React chat widget built on the ConnectyCube platform, enabling real-time messaging, calls, and user engagement in any web app.",
4
+ "version": "0.36.0",
5
5
  "license": "GPL-3.0-only",
6
- "homepage": "https://github.com/ConnectyCube/connectycube-chat-widget#readme",
6
+ "homepage": "https://github.com/ConnectyCube/connectycube-chat-widget/chat-widget#readme",
7
7
  "bugs": {
8
8
  "url": "https://github.com/ConnectyCube/connectycube-chat-widget/issues"
9
9
  },
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "files": [
58
58
  "dist",
59
- "CHANGELOG.md"
59
+ "../../CHANGELOG.md"
60
60
  ],
61
61
  "publishConfig": {
62
62
  "access": "public"
@@ -83,12 +83,7 @@
83
83
  "lint": "eslint .",
84
84
  "test": "vitest",
85
85
  "test:ci": "vitest run",
86
- "coverage": "vitest run --coverage",
87
- "version": "node ./scripts/bump-version.cjs",
88
- "version:patch": "npm run version patch",
89
- "version:minor": "npm run version minor",
90
- "version:major": "npm run version major",
91
- "changelog": "node ./scripts/changelog.cjs"
86
+ "coverage": "vitest run --coverage"
92
87
  },
93
88
  "dependencies": {
94
89
  "@ai-sdk/google": "^2.0.17",
@@ -161,4 +156,4 @@
161
156
  "node": ">=20.0.0",
162
157
  "npm": ">=10.0.0"
163
158
  }
164
- }
159
+ }
package/CHANGELOG.md DELETED
@@ -1,172 +0,0 @@
1
- <a name="0.35.0"></a>
2
-
3
- ## 0.35.0
4
-
5
- ### Bug Fixes
6
-
7
- - “Unknown“ user name and login issue on first open
8
-
9
- ### Chores
10
-
11
- - imports build of the Chat Widget for react@19 as default for ESM. Use `import ChatWidget from "@connectycube/chat-widget/react18"` to import the build for react@18
12
-
13
- <a name="0.34.0"></a>
14
-
15
- ## 0.34.0
16
-
17
- ### Chores
18
-
19
- - new commands in `package.json` to bump major/minor/patch versions
20
-
21
- ### Features
22
-
23
- - call history
24
- - implemented auto-grow text input for typing message
25
- - ability to change tone of message for typed text via AI
26
- - AI text summarization in chat
27
- - new prop `ai` to configure AI options. `ai: { apiKey: string; textSummarization?: boolean; changeMessageTone?: boolean; }`
28
- - supported new variable `CHAT_WIDGET_CONNECTYCUBE_GOOGLE_GENERATIVE_AI_API_KEY` in `.env` to set `ai.apiKey` for "gemini-2.5-flash" model
29
-
30
- <a name="0.33.0"></a>
31
-
32
- ## 0.33.0
33
-
34
- <a name="0.32.1"></a>
35
-
36
- ## 0.32.1
37
-
38
- <a name="0.32.0"></a>
39
-
40
- ## 0.32.0
41
-
42
- <a name="0.31.0"></a>
43
-
44
- ## 0.31.0
45
-
46
- <a name="0.30.2"></a>
47
-
48
- ## 0.30.2
49
-
50
- <a name="0.30.1"></a>
51
-
52
- ## 0.30.1
53
-
54
- <a name="0.30.0"></a>
55
-
56
- ## 0.30.0
57
-
58
- <a name="0.29.0"></a>
59
-
60
- ## 0.29.0
61
-
62
- <a name="0.28.0"></a>
63
-
64
- ## 0.28.0
65
-
66
- <a name="0.27.0"></a>
67
-
68
- ## 0.27.0
69
-
70
- <a name="0.26.1"></a>
71
-
72
- ## 0.26.1
73
-
74
- <a name="0.26.0"></a>
75
-
76
- ## 0.26.0
77
-
78
- <a name="0.25.0"></a>
79
-
80
- ## 0.25.0
81
-
82
- <a name="0.24.0"></a>
83
-
84
- ## 0.24.0
85
-
86
- <a name="0.23.0"></a>
87
-
88
- ## 0.23.0
89
-
90
- <a name="0.22.0"></a>
91
-
92
- ## 0.22.0
93
-
94
- <a name="0.21.1"></a>
95
-
96
- ## 0.21.1
97
-
98
- <a name="0.21.0"></a>
99
-
100
- ## 0.21.0
101
-
102
- <a name="0.20.0"></a>
103
-
104
- ## 0.20.0
105
-
106
- ### Reverts
107
-
108
- - bump connectycube[@4](https://github.com/4).1.4
109
-
110
- <a name="0.19.0"></a>
111
-
112
- ## 0.19.0
113
-
114
- <a name="0.18.0"></a>
115
-
116
- ## 0.18.0
117
-
118
- <a name="0.17.0"></a>
119
-
120
- ## 0.17.0
121
-
122
- <a name="0.16.0"></a>
123
-
124
- ## 0.16.0
125
-
126
- <a name="0.15.2"></a>
127
-
128
- ## 0.15.2
129
-
130
- <a name="0.15.1"></a>
131
-
132
- ## 0.15.1
133
-
134
- <a name="0.15.0"></a>
135
-
136
- ## 0.15.0
137
-
138
- <a name="0.14.4"></a>
139
-
140
- ## 0.14.4
141
-
142
- <a name="0.14.3"></a>
143
-
144
- ## 0.14.3
145
-
146
- ### Reverts
147
-
148
- - [JS-59] update attachments
149
-
150
- <a name="0.14.2"></a>
151
-
152
- ## 0.14.2
153
-
154
- <a name="0.14.0"></a>
155
-
156
- ## 0.14.0
157
-
158
- <a name="0.13.0"></a>
159
-
160
- ## 0.13.0
161
-
162
- <a name="0.12.0"></a>
163
-
164
- ## 0.12.0
165
-
166
- <a name="0.11.0"></a>
167
-
168
- ## 0.11.0
169
-
170
- <a name="0.10.0"></a>
171
-
172
- ## 0.10.0
package/README.md DELETED
@@ -1,202 +0,0 @@
1
- # ConnectyCube Chat Widget
2
-
3
- A React component that seamlessly integrates ConnectyCube's real-time chat capabilities into your web applications. This widget offers an out-of-the-box solution for embedding chat features—such as instant messaging, user presence, and file sharing—without the overhead of building a complete chat system from scratch.
4
-
5
- ## Overview
6
-
7
- The ConnectyCube Web Chat Widget for React is designed to simplify the process of adding chat functionality to your React apps. With a few configuration steps and minimal code, you can quickly enable robust, real-time communication powered by ConnectyCube. Key benefits include:
8
-
9
- - **Easy Integration:** Plug the widget into your existing React projects.
10
- - **Customizable Interface:** Adjust the look and feel to match your brand.
11
- - **Real-Time Messaging:** Leverage ConnectyCube's reliable backend for instant communication.
12
- - **Responsive Design:** Works seamlessly on both desktop and mobile devices.
13
- - **Modular and Extensible:** Adapt the widget to your unique requirements.
14
-
15
- ## Demo
16
-
17
- <https://connectycube-chat-widget.onrender.com>
18
-
19
- Split-view chat widget:
20
-
21
- <kbd><img alt="ConnectyCube chat widget, split view image demo" src="https://developers.connectycube.com/images/chat_widget/chat-widget-1.png" width="400" /></kbd>
22
-
23
- Single-view chat widget:
24
-
25
- <kbd><img alt="ConnectyCube chat widget, single view image demo" src="https://developers.connectycube.com/images/chat_widget/chat-widget-2.png" width="400" /></kbd>
26
-
27
- ## Documentation
28
-
29
- <https://developers.connectycube.com/js/chat-widget>
30
-
31
- ## Installation
32
-
33
- ### React
34
-
35
- ```bash
36
- # npm
37
- npm install @connectycube/chat-widget
38
-
39
- # yarn
40
- yarn add @connectycube/chat-widget
41
- ```
42
-
43
- ### Vanilla JS
44
-
45
- Add the following scripts on your html page somewhere in `head` element:
46
-
47
- ```html
48
- <script src="https://unpkg.com/react@18/umd/react.production.min.js" crossorigin></script>
49
- <script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js" crossorigin></script>
50
- <script src="https://unpkg.com/connectycube@4/dist/connectycube.min.js"></script>
51
- <script src="https://unpkg.com/@connectycube/chat-widget@latest/dist/index.umd.js"></script>
52
- ```
53
-
54
- ## Usage
55
-
56
- ### Before you start
57
-
58
- Before you start, make sure:
59
-
60
- 1. You have access to your ConnectyCube account. If you don’t have an account, [sign up here](https://admin.connectycube.com/register).
61
- 2. An app created in ConnectyCube dashboard. Once logged into [your ConnectyCube account](https://admin.connectycube.com/), create a new application and make a note of the app credentials (**App ID** and **Authorization Key**) that you’ll need for authentication.
62
-
63
- ### Display widget
64
-
65
- #### React
66
-
67
- Import and place the following component in your app:
68
-
69
- ```js
70
- import ConnectyCubeChatWidget from "@connectycube/chat-widget";
71
-
72
- ...
73
-
74
- <ConnectyCubeChatWidget
75
- appId="111"
76
- authKey="11111111-2222-3333-4444-55555555"
77
- config={{ debug: { mode: 1 } }}
78
- userId="112233"
79
- userName="Samuel"
80
- showOnlineUsersTab={false}
81
- splitView={true}
82
- />
83
-
84
- // userName - how other users will see your user name
85
- // userId - a User Id from your system
86
- ```
87
-
88
- See chat widget code samples <https://github.com/ConnectyCube/connectycube-chat-widget-samples> as a reference for faster integration.
89
-
90
- #### React version support
91
-
92
- Since v0.35.0, the default build of the widget targets React 19 and is provided as an ESM module.
93
- For React 18 projects, use the dedicated ESM-only build:
94
-
95
- ```js
96
- // v0.35.0 and later:
97
- import ConnectyCubeChatWidget from '@connectycube/chat-widget'; // default: React 19
98
- import ConnectyCubeChatWidget from '@connectycube/chat-widget/react19'; // explicit React 19 build
99
- import ConnectyCubeChatWidget from '@connectycube/chat-widget/react18'; // dedicated React 18 build
100
-
101
- // v0.34.0 and earlier:
102
- import ConnectyCubeChatWidget from '@connectycube/chat-widget'; // default: React 18
103
- import ConnectyCubeChatWidget from '@connectycube/chat-widget/react19'; // React 19 build
104
- ```
105
-
106
- #### Vanilla JS
107
-
108
- Place the following script in your app:
109
-
110
- ```html
111
- <!doctype html>
112
- <html lang="en">
113
- <head>
114
- <!-- ... -->
115
- </head>
116
- <body>
117
- <!-- ... -->
118
- <!-- @connectycube/chat-widget - start -->
119
- <script src="https://unpkg.com/react@18/umd/react.production.min.js" crossorigin></script>
120
- <script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js" crossorigin></script>
121
- <script src="https://unpkg.com/connectycube@4/dist/connectycube.min.js"></script>
122
- <script src="https://unpkg.com/@connectycube/chat-widget@latest/dist/index.umd.js"></script>
123
- <script>
124
- const chatWidgetContainer = document.createElement('div');
125
- chatWidgetContainer.id = 'ConnectyCube_chat-widget';
126
- document.body.appendChild(chatWidgetContainer);
127
- const props = {
128
- appId: 111,
129
- authKey: '11111111-2222-3333-4444-55555555',
130
- config: { debug: { mode: 1 } },
131
- userId: '112233', // a User Id from your system
132
- userName: 'Samuel', // how other users will see your user name
133
- showOnlineUsersTab: false,
134
- splitView: true,
135
- hideWidgetButton: false,
136
- onOpenChange: (open) => {
137
- console.log('Chat widget is open:', open);
138
- },
139
- onUnreadCountChange: (count) => {
140
- console.log('Unread messages count:', count);
141
- },
142
- };
143
- ReactDOM.createRoot(chatWidgetContainer).render(React.createElement(ConnectyCubeChatWidget, props));
144
-
145
- // use the code below as an example to toggle the chat widget visibility state for custom button
146
- document.getElementById('someCustomButton').addEventListener('click', () => {
147
- ConnectyCubeChatWidget.toggle();
148
- });
149
- </script>
150
- <!-- @connectycube/chat-widget - end -->
151
- </body>
152
- </html>
153
- ```
154
-
155
- See chat widget code samples <https://github.com/ConnectyCube/connectycube-chat-widget-samples> as a reference for faster integration.
156
-
157
- ## Props
158
-
159
- See all available props <https://developers.connectycube.com/js/chat-widget/#props>
160
-
161
- ## Recipes
162
-
163
- See all available recipes <https://developers.connectycube.com/js/chat-widget/#recipes>
164
-
165
- ## SSR (Server-Side Rendering) Guide
166
-
167
- When using `@connectycube/chat-widget` in SSR environments (e.g., Next.js, Remix), some native Node.js modules like events may cause errors due to differences between Node and browser environments. Here are recommendations to ensure smooth SSR integration:
168
-
169
- ### Usage
170
-
171
- ```bash
172
- # npm
173
- npm install @connectycube/chat-widget
174
- npx connectycube patch-ssr # Apply SSR patches
175
- # npx connectycube revert-ssr # Revert SSR patches
176
-
177
- # yarn
178
- yarn add @connectycube/chat-widget
179
- yarn connectycube patch-ssr # Apply SSR patches
180
- # yarn connectycube revert-ssr # Revert SSR patches
181
- ```
182
-
183
- The `connectycube` CLI will be available as part of the `connectycube` package, which is installed automatically as a dependency of `@connectycube/chat-widget`. This script applies fixes to make the SDK compatible with SSR environments.
184
-
185
- ## Have an issue?
186
-
187
- Join our [Discord](https://discord.com/invite/zqbBWNCCFJ) community to get real-time help from our team
188
-
189
- ## Community
190
-
191
- - [Blog](https://connectycube.com/blog)
192
- - X (twitter)[@ConnectyCube](https://x.com/ConnectyCube)
193
- - [Facebook](https://www.facebook.com/ConnectyCube)
194
- - [Medium](https://medium.com/@connectycube)
195
- - [YouTube](https://www.youtube.com/@ConnectyCube)
196
-
197
- **Want to support our team**:<br>
198
- <a href="https://www.buymeacoffee.com/connectycube" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
199
-
200
- ## Changelog
201
-
202
- <https://github.com/ConnectyCube/connectycube-chat-widget-samples/blob/main/CHANGELOG.md>