MCPcopy Index your code
hub / github.com/aws/connect-rtc-js

github.com/aws/connect-rtc-js @v1.3.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.2 ↗ · + Follow
2,344 symbols 5,626 edges 66 files 272 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Build Status

Amazon Connect connect-rtc-js

connect-rtc.js provides softphone support to AmazonConnect customers when they choose to directly integrate with AmazonConnect API and not using AmazonConnect web application. It implements Amazon Connect WebRTC signaling protocol and integrates with browser WebRTC APIs to provide a simple contact session interface which can be integrated with Amazon Connect StreamJS seemlessly.

Usage

Prebuilt releases

In the gh-pages branch prebuilt ready to use files can be downloaded/linked directly.

Working with GitHub registry for Omnissa

Ensure this step is followed before running npm install

Please refer to this GitHub article to authenticate your project and use our public registry.

You will need to create a github token and either authenticate directly or use/create an .npmrc file within your project. An example .npmrc file is as follows:

@euc-releases:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<GITHUB_TOKEN>

Build your own

  1. Install latest LTS version of NodeJS
  2. Install Grunt
  3. git clone https://github.com/aws/connect-rtc-js.git
  4. cd connect-rtc-js
  5. npm install
  6. To build:
    1. grunt
    2. Find build artifacts in out directory
  7. To run unit tests:
    1. npm test
  8. To run demo page:
    1. grunt demo
    2. Open the URL printed out by connect task, it looks like "Started connect web server on https://localhost:9943"
    3. Click demo folder

Amazon Connect StreamJS integration

In a typical amazon-connect-streams integration, connect-rtc-js is not required on parent page. Softphone call handling is done by embedded CCP.

However the following steps could further customize softphone experience. 1. Load connect-rtc-js along with amazon-connect-streams on parent page 2. Following amazon-connect-streams instructions to initialize CCP 3. Replace the softphone parameter (within the second parameter of connect.core.initCCP()) with allowFramedSoftphone: false This would stop embedded CCP from handling softphone call 4. Add this line after initCCP connect.core.initSoftphoneManager({allowFramedSoftphone: true}); This would allow your page to handle softphone call with the connect-rtc-js loaded by your page. allowFramedSoftphone is necessary if your page also lives in a frame, otherwise you can remove that parameter. 5. Add this HTML element to your web page <audio id="remote-audio" autoplay></audio> amazon-connect-streams library will look for this element and inject it into connect-rtc-js so that connect-rtc-js can play downstream audio through this element. 6. Customize it (some ideas below) * Customize audio device for remote-audio element * Look at all the documented APIs in RtcSession class, modify softphone.js as you need * Revert step 4, add your own glue layer between amazon-connect-streams and connect-rtc-js (use softphone.js as a template)

Extension points exported contracts — how you extend this code

WebSocketCallback (Interface)
(no doc) [2 implementers]
test/integration/mocks/mockConnect.ts
MockGlobal (Interface)
(no doc) [1 implementers]
test/unit/globalMock.ts
IceCredentialsForCallResult (Interface)
(no doc)
src/credential_resolver.ts
StandbyPeerConnectionManagerConfig (Interface)
(no doc)
src/standby_peer_connection_manager.ts
AzureMetadata (Interface)
(no doc)
src/strategies/AzureVDIStrategy.ts
AnswerResponse (Interface)
(no doc)
test/integration/mocks/mockConnect.ts
Logger (Interface)
(no doc)
test/unit/shared_media_session_talking_substates.ts
RdpStateChangeEvent (Interface)
(no doc)
src/strategies/AzureVDIStrategy.ts

Core symbols most depended-on inside this repo

info
called by 1157
test/unit/globalMock.ts
log
called by 999
test/unit/globalMock.ts
error
called by 485
test/unit/globalMock.ts
warn
called by 175
test/unit/globalMock.ts
onEnter
called by 77
src/signaling.js
sendApiRequest
called by 65
lib/dcv-webrtc-redir-client-bundle.js
release
called by 57
lib/dcv-webrtc-redir-client-bundle.js
addEventListener
called by 45
test/unit/globalMock.ts

Shape

Method 1,872
Class 280
Function 171
Interface 21

Languages

TypeScript100%

Modules by API surface

release/connect-rtc.min.js758 symbols
lib/dcv-webrtc-redir-client-bundle.js185 symbols
src/rtc_session.js173 symbols
src/signaling.js155 symbols
src/shared_media_session.js144 symbols
src/shared_media_signaling.js124 symbols
src/call_session.js87 symbols
src/shared_media_session_talking_substates.js60 symbols
src/rtc_session_talking_substates.js60 symbols
src/session_report.js59 symbols
src/rtc_peer_connection_manager_v2.ts54 symbols
src/rtc_peer_connection_manager.js45 symbols

For agents

$ claude mcp add connect-rtc-js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page