AWS announces preview of AWS Interconnect - multicloud
AWS announces AWS Interconnect – multicloud (preview), providing simple, resilient, high-speed private connections to other cloud service providers. AWS Interconnect - multicloud is easy to configure and provides high-speed, resilient connectivity with dedicated bandwidth, enabling customers to interconnect AWS networking services such as AWS Transit Gateway, AWS Cloud WAN, and Amazon VPC to other cloud service providers with ease.
Integrating Amazon Connect Streams API: Building a Simple Web App with AWS Amplify
This guide demonstrates how to create a web app integrating Amazon Connect Streams API using AWS Amplify for hosting. Learn to embed the Contact Control Panel and leverage Amazon Connect features in a custom application. Ideal for developers with basic AWS, HTML, and JavaScript knowledge, this tutorial provides a quick start to Connect Streams API integration, addressing the HTTPS domain requirement for Amazon Connect.
Introduction to Amazon Connect Streams API
The Amazon Connect Streams API (Streams) is a powerful tool that enables seamless integration between existing web applications and Amazon Connect. It offers two primary capabilities:
- Embedding the Contact Control Panel (CCP) and Customer Profiles app UI into your web page.
- Handling agent and contact state events through an object-oriented, event-driven interface.
Developers can choose to use the built-in interface or create a custom one from scratch, providing flexibility to meet specific business requirements.
Prerequisites
Before beginning the integration process, ensure you have the following:
- An active Amazon Connect instance
- AWS account with appropriate permissions to use AWS Amplify
- Basic knowledge of HTML and JavaScript
- Git installed on your local machine (optional, for cloning the repository)
- A code editor of your choice (e.g., Visual Studio Code, Sublime Text)
- (For Windows users) 7-Zip or an equivalent file compression tool
Step-by-Step Integration Guide
1. Obtain the Amazon Connect Streams API
You have two options to acquire the Amazon Connect Streams API:
a. Clone the repository:
git clone https://github.com/amazon-connect/amazon-connect-streams
b. Download the ZIP file:
- Visit https://github.com/amazon-connect/amazon-connect-streams
- Click on "Code" and select "Download ZIP"
- Extract the contents of the ZIP file
2. Prepare the Web App Files
- Navigate to the
releasedirectory in the extracted folder. - Create a new file named
index.htmlin this directory. - Open
index.htmlwith your preferred text editor. - Copy and paste the initialization code from the Amazon Connect Streams GitHub page into your
index.htmlfile.
Note: This initialization code serves as a starting point. You can customize and expand it based on your specific requirements.
3. Configure the Connect Instance URL
In the index.html file, locate the following line:
var instanceURL = "https://my-instance-domain.my.connect.aws/ccp-v2/";
Replace my-instance-domain with your Amazon Connect instance alias. To find your instance alias:
- Open the Amazon Connect console.
- Select your instance.
- In the navigation pane, choose "Overview".
- The instance alias is listed in the "Access URL" field.
For more detailed instructions, refer to the AWS documentation on finding your Amazon Connect instance name.
4. Prepare Files for Deployment
- Ensure that both
index.htmlandconnect-streams-min.jsare in the same directory. - Create a ZIP file containing these two files:
- index.html
- connect-streams-min.js
5. Deploy to AWS Amplify
- Open the AWS Amplify Console.
- Choose "Deploy without Git".
- Provide an App name and Environment name.
- Drag and drop the ZIP file you created in step 4.
- Follow the prompts to complete the deployment.
6. Configure Amazon Connect Approved Origins
-
Once deployed, copy the Amplify app URL. It should look like:
https://<envName>.<amplifyAppID>.amplifyapp.com -
Open the Amazon Connect console.
-
Select your instance.
-
In the navigation pane, choose "Approved origins".
-
Click "Add origin" and paste the Amplify app URL.
-
Save the changes.
7. Access Your Web App
- Navigate to your Amplify app URL, appending
/index.htmlto the end. - A new tab will open, prompting you to log in with your Amazon Connect user credentials.
- After successful login, the Contact Control Panel (CCP) will be displayed in your web app.
Additional Considerations and Best Practices
Security
- Implement AWS security best practices, including using IAM roles and policies to manage access to your resources.
- Regularly update your dependencies and review security bulletins related to Amazon Connect and AWS Amplify.
Browser Settings
- Some browsers may block pop-ups by default. Instruct users to allow pop-ups for your app's domain if the login window doesn't appear.
Enhanced Functionality
- Consider implementing additional features to enhance your integration. For example, you can add the ability to pause and resume call recordings using the API described in this AWS blog post.
Troubleshooting
- If you encounter issues during integration or usage:
- Check the browser console for error messages.
- Refer to the Amazon Connect Streams API documentation for troubleshooting tips.
- Ensure all prerequisites are met and steps are followed correctly.
Conclusion
By following this guide, you've successfully created a simple web app that integrates the Amazon Connect Streams API using AWS Amplify for hosting. This integration allows you to embed the Contact Control Panel and leverage the powerful features of Amazon Connect within your own web application.
As you become more familiar with the Streams API, you can expand your integration to include more advanced features and customizations to meet your specific business needs. Remember to keep your code and dependencies up-to-date, and always refer to the latest AWS documentation for best practices and new features that can enhance your Amazon Connect integration.
Relevant content
- asked 2 years ago
- asked 9 months ago
AWS OFFICIALUpdated 4 years ago
AWS OFFICIALUpdated 3 years ago