call-control-sdk 6.0.10 → 6.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/README.md +31 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
### Call Control SDK [](https://www.npmjs.com/package/call-control-sdk) [](https://www.npmjs.com/package/call-control-sdk)
|
|
2
2
|
|
|
3
|
-
A lightweight SDK that provides a utility hooks for managing calls in real-time. and designed for
|
|
3
|
+
A lightweight SDK that provides a utility hooks for managing calls in real-time. and designed for productivity.
|
|
4
4
|
|
|
5
5
|
### ✨ Features
|
|
6
6
|
|
|
@@ -32,11 +32,12 @@ react react-dom axios @mui/material @mui/icons-material @emotion/react @emotion/
|
|
|
32
32
|
- [initSDK](#initsdk)
|
|
33
33
|
- [CallControlPanel](#callcontrolpanel)
|
|
34
34
|
- [updateCallData](#updatecalldata)
|
|
35
|
-
3. [
|
|
35
|
+
3. [SDK Configuration](#sdk-configuration)
|
|
36
|
+
4. [Hooks](#-hooks)
|
|
36
37
|
- [useLogout](#uselogout)
|
|
37
38
|
- [useClickToCall](#useClickToCall)
|
|
38
39
|
- [useEndCall](#useendcall)
|
|
39
|
-
|
|
40
|
+
|
|
40
41
|
5. [Payloads](#-payloads)
|
|
41
42
|
6. [Control Features](#-control-features)
|
|
42
43
|
7. [Browser Support](#-browser-support)
|
|
@@ -192,33 +193,7 @@ Update call data programmatically.
|
|
|
192
193
|
| `callReferenceId?` | string | Unique call reference |
|
|
193
194
|
| `agentLoginId?` | string | Agent login identifier |
|
|
194
195
|
|
|
195
|
-
###
|
|
196
|
-
|
|
197
|
-
#### `useLogout()`
|
|
198
|
-
|
|
199
|
-
Logs out the current agent.
|
|
200
|
-
|
|
201
|
-
```tsx
|
|
202
|
-
const { logOut } = useLogout();
|
|
203
|
-
<button onClick={logOut}>Logout</button>;
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
#### `useStartCall()`
|
|
207
|
-
|
|
208
|
-
Hook for call to mobile number.
|
|
209
|
-
|
|
210
|
-
**Returns**:
|
|
211
|
-
|
|
212
|
-
| Key | Type | Description |
|
|
213
|
-
| ----------------- | -------- | ----------------------------------------------------------------- |
|
|
214
|
-
| `handleStartCall` | function | `(payload: StartCallPayload) => void` – triggers end-call request |
|
|
215
|
-
| `isLoading` | boolean | True while request is pending |
|
|
216
|
-
| `isSuccess` | boolean | True if request succeeded |
|
|
217
|
-
| `isError` | boolean | True if request failed |
|
|
218
|
-
| `error` | any | Error object if failed |
|
|
219
|
-
| `data` | any | API response on success |
|
|
220
|
-
|
|
221
|
-
### ⚙️ SDK Configuration
|
|
196
|
+
### SDK Configuration
|
|
222
197
|
|
|
223
198
|
You can customize the behavior and appearance of the Call Control SDK by passing configuration options to the `initSDK` method. These options allow you to enable/disable specific controls and apply custom styles for maximum productivity and seamless integration.
|
|
224
199
|
|
|
@@ -246,6 +221,32 @@ initSDK({
|
|
|
246
221
|
});
|
|
247
222
|
```
|
|
248
223
|
|
|
224
|
+
### 🪝 Hooks
|
|
225
|
+
|
|
226
|
+
#### `useLogout()`
|
|
227
|
+
|
|
228
|
+
Logs out the current agent.
|
|
229
|
+
|
|
230
|
+
```tsx
|
|
231
|
+
const { logOut } = useLogout();
|
|
232
|
+
<button onClick={logOut}>Logout</button>;
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### `useStartCall()`
|
|
236
|
+
|
|
237
|
+
Hook for call to mobile number.
|
|
238
|
+
|
|
239
|
+
**Returns**:
|
|
240
|
+
|
|
241
|
+
| Key | Type | Description |
|
|
242
|
+
| ----------------- | -------- | ----------------------------------------------------------------- |
|
|
243
|
+
| `handleStartCall` | function | `(payload: StartCallPayload) => void` – triggers end-call request |
|
|
244
|
+
| `isLoading` | boolean | True while request is pending |
|
|
245
|
+
| `isSuccess` | boolean | True if request succeeded |
|
|
246
|
+
| `isError` | boolean | True if request failed |
|
|
247
|
+
| `error` | any | Error object if failed |
|
|
248
|
+
| `data` | any | API response on success |
|
|
249
|
+
|
|
249
250
|
#### `useEndCall()`
|
|
250
251
|
|
|
251
252
|
Hook for ending an active call.
|