Skip to main content

Amazon Web Services

Amazon Connect JavaScript Libraries: Lily CCP, Streams and connect-rtc

Quick post here to describe the various JavaScript libraries that you may run into doing custom Amazon Connect development.

Lily CCP

When you load the Amazon Connect Contact Control Panel (CCP), it loads a JavaScript library called Lily CCP that contains all the code needed to work with the Amazon Connect CTI Web Service and WebRTC API’s. This includes the RTCSession and SoftphoneManager classes we saw in earlier posts. This API is not documented by Amazon and can be considered a private API that we happen to be able to peek into the source code for via browser tools.

Streams API

Amazon Web Services - Avoid Contact Center Outages: Plan Your Upgrade to Amazon Connect
Avoid Contact Center Outages: Plan Your Upgrade to Amazon Connect

Learn the six most common pitfalls when upgrading your contact center, and how Amazon Connect can help you avoid them.

Get the Guide

The Amazon Connect Streams API (Streams) is a public API, documented on GitHub at: https://github.com/aws/amazon-connect-streams. It gives you as a developer access to some parts of LilyRTC, such as the SoftphoneManager and also provides events and methods for call control and agent status. When Lily CCP loads, it creates a global window object of window.connect but there’s almost nothing hanging off of it we can use. When Streams loads, it adds the objects and methods like window.connect.contact() and window.connect.core.initCCP() that we use in custom applications. Again, these methods are not new to Streams, they are actually in Lily CCP, but are not exposed via the global window object.

connect-rtc

Amazon Connect connect-rtc.js (connect-rtc) is another public API, also on GitHub at: https://github.com/aws/connect-rtc-js. It gives you as a developer access to even more of Lily CCP, in this case some of the WebRTC call objects. In past examples this let us get to the underlying media streams involved in an Amazon Connect call. Like with Streams, connect-rtc is mostly taking methods and objects from Lily CCP and attaching to them the global window.connect object. In this case the window.connect.RTCSession and window.connect.RTCErrors objects.

 

Loose ends

  • Streams and connect-rtc also add their objects and methods to a global window.lily object. Not quite sure why, but perhaps as a left-over from when Lily CCP used that object
  • The use of the global window object means you could provide your own JavaScript source files that add the same or modified objects to the window.connect object and thereby “patch” in whatever new behaviors you wanted without modifying Streams or connect-rtc source; this might be an appealing approach if you want to keep your changes to Streams or connect-rtc isolated

I hope this gave you a quick tour of the JavaScript libraries in play for Amazon Connect. Thanks for reading. Any questions, comments or corrections are greatly appreciated. To learn more about what we can do with Amazon Connect, check out Helping You Get the Most Out of Amazon Connect

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Peter Miller

Peter Miller is a Solutions Architect at Perficient focused on call center solutions including Amazon Connect

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram