call-control-sdk 5.2.3 → 5.2.4
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/README.md +3 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/call-control-sdk)
|
|
4
|
-
[](https://www.npmjs.com/package/call-control-sdk)
|
|
5
|
-
[](https://bundlephobia.com/package/call-control-sdk)
|
|
6
|
-
[](#-license)
|
|
1
|
+
### ✨ Call Control SDK [](https://www.npmjs.com/package/call-control-sdk) [](https://www.npmjs.com/package/call-control-sdk)
|
|
7
2
|
|
|
8
3
|
A lightweight SDK that provides a **draggable call control panel** and utility hooks for managing calls in real-time. Built with **TypeScript**, **Material-UI**, and designed for **agent productivity**.
|
|
9
4
|
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 🎥 Demo Preview
|
|
13
|
-
|
|
14
|
-
<img src="https://raw.githubusercontent.com/your-repo/demo.gif" alt="Call Control SDK Demo" width="600" />
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
5
|
## ✨ Features
|
|
19
6
|
|
|
20
7
|
- 🎯 **Complete Call Control** – Hold, Mute, Status management, and End Call
|
|
@@ -26,7 +13,7 @@ A lightweight SDK that provides a **draggable call control panel** and utility h
|
|
|
26
13
|
- 🔧 **TypeScript Support** – Full type safety and IntelliSense
|
|
27
14
|
- 🎪 **Singleton State** – Consistent shared state across components
|
|
28
15
|
|
|
29
|
-
|
|
16
|
+
[](https://bundlephobia.com/package/call-control-sdk)
|
|
30
17
|
|
|
31
18
|
## 📦 Installation
|
|
32
19
|
|
|
@@ -40,8 +27,6 @@ npm install call-control-sdk
|
|
|
40
27
|
npm install react react-dom axios @mui/material @mui/icons-material @emotion/react @emotion/styled
|
|
41
28
|
```
|
|
42
29
|
|
|
43
|
-
---
|
|
44
|
-
|
|
45
30
|
## 📚 Table of Contents
|
|
46
31
|
|
|
47
32
|
1. [Getting Started](#-getting-started)
|
|
@@ -57,8 +42,6 @@ npm install react react-dom axios @mui/material @mui/icons-material @emotion/rea
|
|
|
57
42
|
6. [Browser Support](#-browser-support)
|
|
58
43
|
7. [License](#-license)
|
|
59
44
|
|
|
60
|
-
---
|
|
61
|
-
|
|
62
45
|
## 🚀 Getting Started
|
|
63
46
|
|
|
64
47
|
### 1. Initialize the SDK
|
|
@@ -87,8 +70,6 @@ function App() {
|
|
|
87
70
|
}
|
|
88
71
|
```
|
|
89
72
|
|
|
90
|
-
---
|
|
91
|
-
|
|
92
73
|
### 2. Add the Call Control Panel
|
|
93
74
|
|
|
94
75
|
```tsx
|
|
@@ -108,8 +89,6 @@ export default function App() {
|
|
|
108
89
|
}
|
|
109
90
|
```
|
|
110
91
|
|
|
111
|
-
---
|
|
112
|
-
|
|
113
92
|
### 3. Logout Agent
|
|
114
93
|
|
|
115
94
|
```tsx
|
|
@@ -121,8 +100,6 @@ export default function LogoutButton() {
|
|
|
121
100
|
}
|
|
122
101
|
```
|
|
123
102
|
|
|
124
|
-
---
|
|
125
|
-
|
|
126
103
|
### 4. End Call
|
|
127
104
|
|
|
128
105
|
```tsx
|
|
@@ -149,8 +126,6 @@ export default function EndCallButton() {
|
|
|
149
126
|
}
|
|
150
127
|
```
|
|
151
128
|
|
|
152
|
-
---
|
|
153
|
-
|
|
154
129
|
## 🛠 Core API
|
|
155
130
|
|
|
156
131
|
### `initSDK(config)`
|
|
@@ -165,8 +140,6 @@ Initializes the SDK. Must be called **before using any components or hooks**.
|
|
|
165
140
|
| `tenantId` | string | ✅ | Tenant ID for events/authentication |
|
|
166
141
|
| `agentId` | string | ✅ | Agent ID for call controls |
|
|
167
142
|
|
|
168
|
-
---
|
|
169
|
-
|
|
170
143
|
### `CallControlPanel`
|
|
171
144
|
|
|
172
145
|
Draggable control panel for call management.
|
|
@@ -177,8 +150,6 @@ Draggable control panel for call management.
|
|
|
177
150
|
| --------------- | -------- | -------- | -------------------------------------------------------------------------------------------------- |
|
|
178
151
|
| `onDataChange?` | function | ❌ | Callback fired when call data changes. Receives `{ mobileNumber, callReferenceId, agentLoginId }`. |
|
|
179
152
|
|
|
180
|
-
---
|
|
181
|
-
|
|
182
153
|
### `updateCallData(data: Partial<CallData>)`
|
|
183
154
|
|
|
184
155
|
Update call data programmatically.
|
|
@@ -191,8 +162,6 @@ Update call data programmatically.
|
|
|
191
162
|
| `callReferenceId?` | string | Unique call reference |
|
|
192
163
|
| `agentLoginId?` | string | Agent login identifier |
|
|
193
164
|
|
|
194
|
-
---
|
|
195
|
-
|
|
196
165
|
## 🪝 Hooks
|
|
197
166
|
|
|
198
167
|
### `useLogout()`
|
|
@@ -204,8 +173,6 @@ const { logOut } = useLogout();
|
|
|
204
173
|
<button onClick={logOut}>Logout</button>;
|
|
205
174
|
```
|
|
206
175
|
|
|
207
|
-
---
|
|
208
|
-
|
|
209
176
|
### `useEndCall()`
|
|
210
177
|
|
|
211
178
|
Hook for ending an active call.
|
|
@@ -221,8 +188,6 @@ Hook for ending an active call.
|
|
|
221
188
|
| `error` | any | Error object if failed |
|
|
222
189
|
| `data` | any | API response on success |
|
|
223
190
|
|
|
224
|
-
---
|
|
225
|
-
|
|
226
191
|
## 📦 Payloads
|
|
227
192
|
|
|
228
193
|
### `EndCallPayload`
|
|
@@ -233,16 +198,12 @@ interface EndCallPayload {
|
|
|
233
198
|
}
|
|
234
199
|
```
|
|
235
200
|
|
|
236
|
-
---
|
|
237
|
-
|
|
238
201
|
## 🎛 Control Features
|
|
239
202
|
|
|
240
203
|
- **Status Management**: Idle / Break
|
|
241
204
|
- **Call Controls**: Hold / Resume, Mute / Unmute, End Call, Agent Status
|
|
242
205
|
- **Persistent State**: Hold, mute, agent status, panel position, call timer
|
|
243
206
|
|
|
244
|
-
---
|
|
245
|
-
|
|
246
207
|
## 🌍 Browser Support
|
|
247
208
|
|
|
248
209
|
- ✅ Chrome 60+
|
|
@@ -254,4 +215,4 @@ interface EndCallPayload {
|
|
|
254
215
|
|
|
255
216
|
## 📄 License
|
|
256
217
|
|
|
257
|
-
MIT © 2025
|
|
218
|
+
MIT © 2025 [](#-license)
|