-
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
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
[2] https://docs.aws.amazon.com/agentworkspace/latest/devguide/getting-started-initialize-sdk.html
'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