Using Web Chat inside create-react-app
.
const App = () => <ReactWebChat ... />;
Using Web Chat with ReactDOM.render
outside of create-react-app
.
<script src=".../webchat-es5.js"></script>
<script>
ReactDOM.render(<ReactWebChat ... />, document.getElementById('webchat'));
</script>
Using Web Chat with renderWebChat
with ES5 bundle.
<script src=".../webchat-es5.js"></script>
<script>
renderWebChat({ ... }, document.getElementById('webchat'));
</script>
Using Web Chat with renderWebChat
with full bundle.
<script src=".../webchat.js"></script>
<script>
renderWebChat({ ... }, document.getElementById('webchat'));
</script>
Using Web Chat with renderWebChat
with minimal bundle.
<script src=".../webchat-minimal.js"></script>
<script>
renderWebChat({ ... }, document.getElementById('webchat'));
</script>
Using Web Chat with renderWebChat
with some JSX.
<script src=".../webchat-es5.js"></script>
<script>
renderWebChat(
{
activityMiddleware: () => next => card => children => (
<ActivityContainer>{next(card)(children)}</ActivityContainer>
),
...
},
document.getElementById('webchat')
);
</script>
Using Web Chat hosted like CDC.
<iframe src="cdc.html"></iframe>
Using Web Chat bundled by ESBuild.
const App = () => <ReactWebChat ... />;
Using Web Chat bundled by Webpack 4 in CJS.
const App = () => <ReactWebChat ... />;
Using Web Chat bundled by Webpack 4 in ESM.
const App = () => <ReactWebChat ... />;
Using Web Chat bundled by Webpack 5.
const App = () => <ReactWebChat ... />;