I am trying to integrate bot with React js but is shows me two logos instead of one... here is the code :-
// import logo from './logo.svg';
// import './App.css';
import React, { useEffect } from 'react';
function App() {
useEffect(() => {
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = process.env.BOT_URL;
script.async = true;
script.onload = () => {
window.botpressWebChat.init({
"botId": process.env.BOT_ID,
"hostUrl": process.env.HOST_URL,
"messagingUrl": "https://messaging.botpress.cloud",
"clientId": process.env.CLIent_ID,
"botName": "Dashboard Bot",
"phoneNumber": "+91 456789",
"termsConditions": "https://abcd.com/terms",
"privacyPolicy": "https://abcd.com/privacy",
"emailAddress": "abcd@gmail.com",
"website": "abcd@gmail.com",
"useSessionStorage": true,
"showPoweredBy": true,
});
window.botpressWebChat.onEvent(() => {
window.botpressWebChat.sendEvent({ type: 'show' });
}, []);
}
document.body.appendChild(script);
return () => {
document.body.removeChild(script);
};
}, []);
return (
);
}
export default App;
Can somebody help me with this issue ???