-
AWS Amazon Connect App @amazon-connect/app 설정DEV/aws 2024. 1. 15. 14:27
Amazon Connect Agent Workspace의 document를 참고하였고 React에 올려서 테스트하였다.
1. React app 생성
https://seokbong.tistory.com/116
React node로 react app 만들기 및 실행
*node가 설치되어 있어야 함. react app을 만드는 명령어는 다음과 같다. npx create-react-app [앱 이름] 설치 후 하단 명령어를 통해 해당 폴더로 진입 및 실행 cd [앱 이름] npm start https://reactjs.org/docs/create-
seokbong.tistory.com
2. Amazon-connect/app설치
// 생성한 React app 내부 진입 후 npm install --save @amazon-connect/app
3. AmazonConnectApp 불러오기
생성한 React App 내부 path : ./src/index.js
import React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; // 초기 설정된 Index.js 에서 하단 코드 추가 ======================= import { AmazonConnectApp } from "@amazon-connect/app"; const { connectApp } = AmazonConnectApp.init({ onCreate: (event) => { const { appInstanceId } = event.context; console.log('App initialized: ', appInstanceId); }, onDestroy: (event) => { console.log('App being destroyed'); }, }); // ========================================================= const root = ReactDOM.createRoot(document.getElementById('root')); root.render( <React.StrictMode> <App /> </React.StrictMode> ); // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals();
4. 실행
npm start
5. 콘솔 확인
AWS Connect에 올리지 않은 경우(일반적인 로컬 환경에서는) 아래와 같은 경고문구 발생
(해당 에러가 발생해야 정상적으로 작동하는 것)
Ref [2]의 하단 참조
6. build
npm run build
Ref.
[1] https://docs.aws.amazon.com/agentworkspace/latest/devguide/getting-started-create-application.html
Creating your application - Agent Workspace
Creating your application An application is a website that can be loaded from an HTTPS URL into an iframe in the agent workspace. It can be built using any frontend framework and hosted anywhere as long as it can be loaded by the user’s browser and suppo
docs.aws.amazon.com
[2] https://docs.aws.amazon.com/agentworkspace/latest/devguide/getting-started-initialize-sdk.html
Initialize the SDK in your application - Agent Workspace
Initialize the SDK in your application Initializing the SDK in your app requires calling init on the AmazonConnectApp module. This takes an onCreate and onDestroy callback, which will be invoked once the app has successfully initialized in the workspace an
docs.aws.amazon.com
'DEV > aws' 카테고리의 다른 글
AWS Lambda Node로 axios require 해보기, 함수 만들기 부터... (0) 2024.01.19 AWS Lambda란...? (0) 2024.01.17 AWS Bedrock이란..? (0) 2024.01.12 AWS Kendra SDK(Vanilla javascript) 기본 설정 - CDN, Client, QueryCommand (0) 2024.01.12 AWS Zendesk에 Kendra 끼얹기 (1) 2024.01.05