Skip to content

Commit

Permalink
Update README and bump version (#238)
Browse files Browse the repository at this point in the history
* README and Documentation.md updates

* version bump
  • Loading branch information
ctwomblyamzn authored Apr 16, 2020
1 parent 9d4ccb4 commit cea2c59
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
58 changes: 44 additions & 14 deletions Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

## Overview
The Amazon Connect Streams API (Streams) gives you the power to integrate your
existing web applications with Amazon Connect. Streams gives you the power to
existing web applications with Amazon Connect. Streams lets you
embed the Contact Control Panel (CCP) UI components into your page, and/or
handle agent and contact state events directly giving you the power to control
agent and contact state through an object oriented event driven interface. You
can use the built in interface or build your own from scratch: Streams gives you
the power to choose.
the choice. This library must be used in conjunction with [amazon-connect-chatjs](https://github.com/amazon-connect/amazon-connect-chatjs)
in order to utilize Amazon Connect's Chat functionality.

## Architecture
Click [here](Architecture.md) to view a quick architecture overview of how the
Expand Down Expand Up @@ -40,8 +41,20 @@ To whitelist your pages:
* All open tabs that contain an initialized Streams library or any other CCP
tabs opened will be synchronized. This means that state changes made in one
open window will be communicated to all open windows.
* Using multiple browsers at the same time for the same connect instance is not supported, and causes issues with the rtc communication.

### Downloading Streams

### Downloading Streams with npm

`npm install amazon-connect-streams`

# Importing Streams with npm and ES6

`import "amazon-connect-streams";`

This will make the `connect` variable available in the current context.

### Downloading Streams from Github
The next step to embedding Amazon Connect into your application is to download the
Streams library from GitHub. You can do that by cloning our public repository
here:
Expand Down Expand Up @@ -90,17 +103,34 @@ everything set up correctly and that you are able to listen for events.

### `connect.core.initCCP()`
```
connect.core.initCCP(containerDiv, {
ccpUrl: ccpUrl, /*REQUIRED*/
loginPopup: true, /*optional, default TRUE*/
loginUrl: loginUrl, /*optional*/
loginPopupAutoClose: true, /*optional*/
region: region /*REQUIRED*/
softphone: { /*optional*/
disableRingtone: true, /*optional*/
ringtoneUrl: ringtoneUrl /*optional*/
}
});
<!DOCTYPE html>
<meta charset="UTF-8">
<html>
<head>
<script type="text/javascript" src="amazon-connect-1.4.js"></script>
</head>
<!-- Add the call to init() as an onload so it will only run once the page is loaded -->
<body onload="init()">
<div id=containerDiv style="width: 400px;height: 800px;"></div>
<script type="text/javascript">
const instanceURL = "https://my-instance-domain.awsapps.com/connect/ccp-v2/";
// initialise the streams api
function init(){
// initialize the ccp
connect.core.initCCP(containerDiv, {
ccpUrl: instanceURL, /*REQUIRED*/
loginPopup: true, /*optional, default TRUE*/
region: "eu-central-1", /*REQUIRED for chat, optional otherwise*/
softphone: { /*optional*/
allowFramedSoftphone: true, /*optional*/
disableRingtone: false, /*optional*/
ringtoneUrl: "./ringtone.mp3" /*optional*/
}
});
}
</script>
</body>
</html>
```
Integrates with Amazon Connect by loading the pre-built CCP located at `ccpUrl` into an
iframe and placing it into the `containerDiv` provided. API requests are
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ To whitelist your pages:
website is hosted on a non-standard port.

#### A few things to note:
* Whitelisted domains must be HTTPS.
* All of the pages that attempt to initialize the Streams library must be hosted
on domains that are whitelisted as per the above steps.
* All open tabs that contain an initialized Streams library or any other CCP
tabs opened will be synchronized. This means that state changes made in one
open window will be communicated to all open windows.
* Using multiple browsers at the same time for the same connect instance is not supported, and causes issues with the rtc communication.

### Downloading Streams with npm
`npm install amazon-connect-streams`
Expand Down Expand Up @@ -144,6 +146,11 @@ and made available to your JS client code.
* `region`: Amazon connect instance region. ex: us-west-2 for PDX ccp instance. only required for chat channel.
* `loginPopup`: Optional, defaults to `true`. Set to `false` to disable the login
popup which is shown when the user's authentication expires.
* `loginPopupAutoClose`: Optional, defaults to `false`. Set to `true` in conjunction with the `loginPopup` parameter
to automatically close the login Popup window once the authentication step has completed.
If the login page opened in a new tab, this parameter will also auto-close that tab.
* `loginUrl`: Optional. Allows custom URL to be used to initiate the ccp, as in
the case of SAML authentication.
* `softphone`: This object is optional and allows you to specify some settings
surrounding the softphone feature of Connect.
* `allowFramedSoftphone`: Normally, the softphone microphone and speaker
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazon-connect-streams",
"version": "1.4.6",
"version": "1.4.7",
"description": "Amazon Connect Streams Library",
"engines": {
"node": ">=12.0.0"
Expand Down

0 comments on commit cea2c59

Please sign in to comment.