Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/labs/contact-center/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>Webex Contact Center SDK Lab</h1>
<a href="https://github.com/webex/webex-js-sdk" target="_blank">Webex JavaScript SDK</a>. For simplicity,
we're using a CDN version of the SDK in this lab, but in production applications, you would typically
install
it via npm (<code>@webex/plugin-cc</code> Will be renamed to @webex/contact-center soon).
it via npm (<code>@webex/contact-center</code> Will be renamed to @webex/contact-center soon).
</p>
<p><strong>Important Prerequisite:</strong> Before starting this lab, ensure your Webex Contact Center is set up
and configured. For detailed instructions on setting up your Contact Center environment, please refer to the
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"build:dev": "NODE_ENV=development node ./tooling/index.js build",
"prebuild:modules": "yarn && yarn @tools build:src && yarn @legacy-tools build:src && yarn workspace @webex/webex-core build:src && yarn @all build:src",
"prebuild:docs": "rimraf ./docs/api",
"build:docs": "yarn workspace @webex/plugin-presence run build:docs && yarn workspace @webex/calling run build:docs && yarn workspace @webex/byods run build:docs && yarn workspace @webex/plugin-cc run build:docs && yarn workspace @webex/plugin-encryption run build:docs && documentation build --config documentation/config.yml --format html --output ./docs/api --github ./packages/webex/src/index.js ./packages/@webex/plugin-*/src/index.[tj]s --babel=./babel.config.json",
"build:docs": "yarn workspace @webex/plugin-presence run build:docs && yarn workspace @webex/calling run build:docs && yarn workspace @webex/byods run build:docs && yarn workspace @webex/contact-center run build:docs && yarn workspace @webex/plugin-encryption run build:docs && documentation build --config documentation/config.yml --format html --output ./docs/api --github ./packages/webex/src/index.js ./packages/@webex/contact-center/src/index.[tj]s ./packages/@webex/plugin-*/src/index.[tj]s --babel=./babel.config.json",
"check-karma-output": "./scripts/analyze-output.sh",
"build:package": "node ./tooling/index.js build",
"changelog:generate": "npx standard-changelog",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
### Table of Contents

- [Getting Started](#getting-started)
- [Developing](#developing)
- [Building](#building)
- [Building](#building)
- [Testing](#testing)
- [Samples](#samples)
- [Samples](#samples)
- [Consuming SDK](#consuming-sdk)
- [NPM](#npm)
- [CDN](#cdn)
- [Kitchen Sink App](#kitchen-sink-app)

---

## Getting Started

The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.

- [Introduction to the Webex Web Calling SDK]()
- [Quickstart guide]().

## Developing

```bash
Expand All @@ -38,33 +41,41 @@ yarn build:local
## Testing

```bash
yarn workspace @webex/plugin-cc run test:unit
yarn workspace @webex/contact-center run test:unit
```

## Samples
## Samples

```bash
yarn run samples:serve
```

## Consuming SDK

To consume the latest stable version of the Calling SDK one can use NPM or CDN.

# NPM

```javascript
npm install @webex/plugin-cc
npm install @webex/contact-center
```

(or)

```javascript
yarn add @webex/plugin-cc
yarn add @webex/contact-center
```

```javascript
import ContactCenter from '@webex/plugin-cc'
import ContactCenter from '@webex/contact-center';
```

# CDN

```javascript
<script src="../contact-center.min.js"></script>
<script src="../contact-center.min.js"></script>
```

### Kitchen Sink App
To test Contact Center SDK API, use this Kitchen Sink app: https://webex.github.io/webex-js-sdk/samples/contact-center/

To test Contact Center SDK API, use this Kitchen Sink app: https://webex.github.io/webex-js-sdk/samples/contact-center/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@webex/plugin-cc",
"name": "@webex/contact-center",
"description": "This package provides a set of APIs to perform various operations for the Agent flow within Webex Contact Center",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"contributors": [
Expand All @@ -26,7 +26,7 @@
"repository": {
"type": "git",
"url": "https://github.com/webex/webex-js-sdk.git",
"directory": "packages/@webex/plugin-cc"
"directory": "packages/@webex/contact-center"
},
"engines": {
"node": ">=20.x"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Constants for Task Service
* @module @webex/plugin-cc/services/task/constants
* @module @webex/contact-center/services/task/constants
* @ignore
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ const Webex = WebexCore.extend({
* The merged configuration governs various SDK behaviors, such as authorization, logging, and CC-specific settings.
*
* @example <caption>Basic Usage</caption>
* import Webex from '@webex/plugin-cc';
* import Webex from '@webex/contact-center';
*
* // Initialize Webex SDK with default configuration
* const webex = Webex.init();
*
* @example <caption>Custom Configuration</caption>
* import Webex from '@webex/plugin-cc';
* import Webex from '@webex/contact-center';
*
* const customConfig = {
* logger: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"categoryOrder": ["Core", "Services", "Classes", "Interfaces", "Enum", "Types", "*"],
"navigationLinks": {
"Home": "/",
"NPM": "http://npmjs.com/package/@webex/plugin-cc",
"NPM": "http://npmjs.com/package/@webex/contact-center",
"GitHub": "https://github.com/webex/webex-js-sdk"
},
"searchInComments": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Webex JS SDK: Contact Center Plugin

Welcome to **@webex/plugin-cc**, a plugin for the [Webex JS SDK](https://github.com/webex/webex-js-sdk). This package enables integration with Webex Contact Center, providing APIs for agent management, task handling, and real-time communications.
Welcome to **@webex/contact-center**, a plugin for the [Webex JS SDK](https://github.com/webex/webex-js-sdk). This package enables integration with Webex Contact Center, providing APIs for agent management, task handling, and real-time communications.

## Features

Expand All @@ -13,43 +13,43 @@ Welcome to **@webex/plugin-cc**, a plugin for the [Webex JS SDK](https://github.
## Installation

```bash
npm install @webex/plugin-cc
npm install @webex/contact-center
```

## Initialization

Initialize the Contact Center plugin with the Webex SDK. The `config` parameter is optional, but you can pass any of the following options for `cc`:

```javascript
import Webex from '@webex/plugin-cc';
import Webex from '@webex/contact-center';

const config = {
credentials: {
access_token: 'your-access-token', // Required for authentication
},
logger: {
level: 'debug', // Enhanced logging for development
bufferLogLevel: 'log' // Log level for uploaded logs
level: 'debug', // Enhanced logging for development
bufferLogLevel: 'log', // Log level for uploaded logs
},
cc: {
// Agent session management
allowMultiLogin: false, // Prevent multiple agent sessions
allowAutomatedRelogin: true, // Auto reconnect on disconnection
allowMultiLogin: false, // Prevent multiple agent sessions
allowAutomatedRelogin: true, // Auto reconnect on disconnection

// Connection settings
clientType: 'WebexCCSDK', // Identify client type
isKeepAliveEnabled: false, // Websocket keep-alive
force: true, // Force connection parameters
clientType: 'WebexCCSDK', // Identify client type
isKeepAliveEnabled: false, // Websocket keep-alive
force: true, // Force connection parameters

// Metrics configuration
metrics: {
clientName: 'WEBEX_JS_SDK',
clientType: 'WebexCCSDK'
}
}
clientType: 'WebexCCSDK',
},
},
};

const webex = Webex.init({ config }); // config is optional
const webex = Webex.init({config}); // config is optional
const cc = webex.cc;

webex.once('ready', () => {
Expand All @@ -64,11 +64,13 @@ webex.once('ready', () => {
The [ContactCenter](./classes/ContactCenter.html) class is your primary interface for agent operations. Key capabilities include:

1. **Session Management**:

- Agent registration and initialization
- Connection management
- Event handling

2. **Agent Operations**:

- Station login/logout
- State management (Available/Idle)
- Profile updates
Expand All @@ -86,19 +88,19 @@ async function initializeAgent() {
try {
// 1. Register with contact center
const profile = await cc.register();

// 2. Login with browser-based calling
await cc.stationLogin({
teamId: profile.teams[0].teamId,
loginOption: 'BROWSER'
loginOption: 'BROWSER',
});

// 3. Set availability state
await cc.setAgentState({
state: 'Available',
auxCodeId: '0'
auxCodeId: '0',
});

console.log('Agent initialized and ready');
} catch (error) {
console.error('Initialization failed:', error);
Expand All @@ -111,11 +113,13 @@ async function initializeAgent() {
The [Task](./classes/Task.html) class represents an interaction (call, chat, etc.) and provides methods for:

1. **Media Control**:

- Mute/unmute
- Hold/resume
- Recording controls

2. **Call Flow**:

- Accept/decline tasks
- Transfer operations
- Consultation features
Expand All @@ -133,27 +137,26 @@ cc.on('task:incoming', async (task) => {
try {
// 1. Accept the task
await task.accept();

// 2. Set up media handling (for voice)
task.on('task:media', (track) => {
const audio = document.getElementById('remote-audio');
audio.srcObject = new MediaStream([track]);
});

// 3. Handle task states
task.on('task:hold', () => {
console.log('Task placed on hold');
});

task.on('task:end', async () => {
if (task.data.wrapUpRequired) {
await task.wrapup({
auxCodeId: 'RESOLVED',
wrapUpReason: 'Customer issue resolved'
wrapUpReason: 'Customer issue resolved',
});
}
});

} catch (error) {
console.error('Task handling failed:', error);
}
Expand Down
3 changes: 3 additions & 0 deletions packages/@webex/contact-center/umd/contact-center.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/webex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@babel/runtime-corejs2": "^7.14.8",
"@webex/calling": "workspace:*",
"@webex/common": "workspace:*",
"@webex/contact-center": "workspace:*",
"@webex/internal-plugin-calendar": "workspace:*",
"@webex/internal-plugin-device": "workspace:*",
"@webex/internal-plugin-dss": "workspace:*",
Expand All @@ -77,7 +78,6 @@
"@webex/internal-plugin-voicea": "workspace:*",
"@webex/plugin-attachment-actions": "workspace:*",
"@webex/plugin-authorization": "workspace:*",
"@webex/plugin-cc": "workspace:*",
"@webex/plugin-device-manager": "workspace:*",
"@webex/plugin-encryption": "workspace:*",
"@webex/plugin-logger": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/webex/src/webex.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require('@webex/plugin-teams');
require('@webex/plugin-team-memberships');
require('@webex/plugin-webhooks');
require('@webex/plugin-encryption');
require('@webex/plugin-cc');
require('@webex/contact-center');

const merge = require('lodash/merge');
const WebexCore = require('@webex/webex-core').default;
Expand Down
3 changes: 3 additions & 0 deletions packages/webex/umd/calling.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/webex/umd/calling.min.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/webex/umd/encryption.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/webex/umd/encryption.min.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/webex/umd/meetings.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/webex/umd/meetings.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/webex/umd/webex.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/webex/umd/webex.min.js.map

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = (env = {NODE_ENV: process.env.NODE_ENV || 'production'}) => ({
},
},
'contact-center': {
import: `${path.resolve(__dirname)}/packages/@webex/plugin-cc/src/webex.js`,
import: `${path.resolve(__dirname)}/packages/@webex/contact-center/src/webex.js`,
library: {
name: 'Webex',
type: 'umd',
Expand All @@ -65,12 +65,14 @@ module.exports = (env = {NODE_ENV: process.env.NODE_ENV || 'production'}) => ({
},
mode: env && env.NODE_ENV === 'development' ? 'development' : 'production',
output: {
filename: '[name].min.js',
sourceMapFilename: '[file].map',
path:
env && env.umd
? `${path.resolve(__dirname)}/packages/webex/umd`
: `${path.resolve(__dirname)}/docs/samples`,
path: path.resolve(__dirname),
filename: (pathData) => {
if (pathData.chunk.name === 'contact-center' && env && env.umd) {
return 'packages/@webex/contact-center/umd/[name].min.js';
}

return env && env.umd ? 'packages/webex/umd/[name].min.js' : 'docs/samples/[name].min.js';
},
},
devtool: env && env.NODE_ENV === 'development' ? 'eval-cheap-module-source-map' : 'source-map',
devServer: {
Expand Down
Loading
Loading