call-control-sdk 1.0.0 → 2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # React Call Control SDK
2
2
 
3
- A React-based call control SDK with Material-UI components, providing a draggable control panel for call management.
3
+ Achala provide call control SDK with Material-UI components, providing a draggable control panel for call management.
4
4
 
5
5
  ## Features
6
6
 
@@ -16,7 +16,7 @@ A React-based call control SDK with Material-UI components, providing a draggabl
16
16
  ## Installation
17
17
 
18
18
  ```bash
19
- npm install react-call-control-sdk
19
+ npm install call-control-sdk
20
20
  ```
21
21
 
22
22
  ## Peer Dependencies
@@ -32,17 +32,21 @@ npm install react react-dom @mui/material @mui/icons-material @emotion/react @em
32
32
  ### 1. Initialize the SDK
33
33
 
34
34
  ```typescript
35
- import { initCallSDK } from 'react-call-control-sdk';
35
+ import { initCallSDK } from 'call-control-sdk';
36
36
 
37
37
  // Initialize at the top level of your app
38
- initCallSDK('YOUR_API_KEY');
38
+ initSDK(
39
+ "API_KEY",
40
+ "TENANT_ID",
41
+ "AGENT_ID",
42
+ "BASE_URL");
39
43
  ```
40
44
 
41
45
  ### 2. Use the CallControlPanel
42
46
 
43
47
  ```typescript
44
48
  import React from 'react';
45
- import { CallControlPanel } from 'react-call-control-sdk';
49
+ import { CallControlPanel } from 'call-control-sdk';
46
50
 
47
51
  function App() {
48
52
  const handleDataChange = ({ mobileNumber, callReferenceId, agentLoginId }) => {
@@ -58,24 +62,11 @@ function App() {
58
62
  }
59
63
  ```
60
64
 
61
- ### 3. Update Call Data (Optional)
62
-
63
- ```typescript
64
- import { updateCallData } from 'react-call-control-sdk';
65
-
66
- // Update call information
67
- updateCallData({
68
- mobileNumber: '+1-555-123-4567',
69
- callReferenceId: 'CALL-2024-001',
70
- agentLoginId: 'AGENT-123'
71
- });
72
- ```
73
-
74
65
  ## API Reference
75
66
 
76
- ### `initCallSDK(sdkApiKey: string)`
67
+ ### `initSDK(sdkApiKey: string, tenantId: string, agentId: string, baseUrl: string)`
77
68
 
78
- Initializes the SDK with an API key. Must be called before using any components.
69
+ Initializes the SDK with an API key, tenantId, agentId, baseUrl. Must be called before using any components.
79
70
 
80
71
  **Parameters:**
81
72
  - `sdkApiKey` (string): Your API key for SDK authentication
@@ -103,7 +94,6 @@ Updates the call data that will be passed to the `onDataChange` callback.
103
94
 
104
95
  ### Status Management
105
96
  - **Idle**: Default state, no active call
106
- - **Ready**: Agent is ready to take calls
107
97
  - **Break**: Agent is on break
108
98
 
109
99
  ### Call Controls
@@ -153,4 +143,4 @@ function App() {
153
143
 
154
144
  ## License
155
145
 
156
- MIT © [Your Name]
146
+ MIT © RDX
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface CallData {
4
+ mobileNumber: string;
5
+ callReferenceId: string;
6
+ agentLoginId: string;
7
+ }
8
+ interface CallControlPanelProps {
9
+ onDataChange?: (data: CallData) => void;
10
+ }
11
+ type CallStatus = "idle" | "ready" | "break";
12
+
13
+ declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element;
14
+
15
+ /**
16
+ * Initialize the Call Control SDK with an API key
17
+ * @param sdkApiKey - The API key for SDK authentication
18
+ * @throws {Error} When API key is missing or invalid
19
+ */
20
+ declare function initSDK(sdkApiKey: string, tenantId: string, agentId: string, baseUrl: string): void;
21
+
22
+ export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK };
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface CallData {
4
+ mobileNumber: string;
5
+ callReferenceId: string;
6
+ agentLoginId: string;
7
+ }
8
+ interface CallControlPanelProps {
9
+ onDataChange?: (data: CallData) => void;
10
+ }
11
+ type CallStatus = "idle" | "ready" | "break";
12
+
13
+ declare function CallControlPanel({ onDataChange }: CallControlPanelProps): react_jsx_runtime.JSX.Element;
14
+
15
+ /**
16
+ * Initialize the Call Control SDK with an API key
17
+ * @param sdkApiKey - The API key for SDK authentication
18
+ * @throws {Error} When API key is missing or invalid
19
+ */
20
+ declare function initSDK(sdkApiKey: string, tenantId: string, agentId: string, baseUrl: string): void;
21
+
22
+ export { CallControlPanel, type CallControlPanelProps, type CallData, type CallStatus, initSDK };