gorgeous-pencil-71524
06/11/2025, 12:26 PMgorgeous-pencil-71524
06/11/2025, 12:28 PMwindow.botpress is undefinedgorgeous-pencil-71524
06/11/2025, 12:39 PM@botpress/webchat
https://cdn.discordapp.com/attachments/1382335122748997662/1382338536665124954/Screenshot_2025-06-11_at_14.38.16.png?ex=684aca95&is=68497915&hm=4912218865e1153146353162c2062e526727055bece030d846376c7c50ef7f57&gorgeous-pencil-71524
06/11/2025, 12:40 PMgorgeous-pencil-71524
06/11/2025, 12:40 PMgorgeous-pencil-71524
06/11/2025, 12:46 PMgorgeous-pencil-71524
06/11/2025, 1:44 PMprehistoric-airplane-85682
06/11/2025, 1:45 PMgorgeous-pencil-71524
06/11/2025, 1:48 PMgorgeous-pencil-71524
06/11/2025, 1:50 PMReact.useEffect(() => {
console.log("Webchat onMessage2", onMessage);
onMessage("message", (message) => {
console.log("Webchat opened", message);
});
onMessage("messageSent", (message) => {
console.log("Webchat opened", message);
});
onMessage("webchatVisibility", (message) => {
console.log("webchatVisibility", message);
});
}, [onMessage]);prehistoric-airplane-85682
06/11/2025, 1:52 PMgorgeous-pencil-71524
06/11/2025, 2:20 PMgorgeous-pencil-71524
06/11/2025, 2:21 PMgorgeous-pencil-71524
06/11/2025, 4:03 PMmodern-honey-58818
06/18/2025, 9:40 AMgorgeous-pencil-71524
06/20/2025, 2:53 PMmodern-honey-58818
07/08/2025, 6:42 AMmodern-honey-58818
07/08/2025, 6:42 AMbetter-needle-45600
07/30/2025, 9:32 AMmodern-honey-58818
08/13/2025, 11:38 AMeager-forest-85623
08/25/2025, 9:36 PMuseWebchat hook and the <Webchat> component creating two seperate instances of the Webchat client, which weren't communicating properly.
As per our front-end team, the useWebchat hook wasn't designed to be used with the batteries-included <Webchat> component—I've [updated the docs](https://botpress.com/docs/webchat/react-library/hooks/use-webchat-client) accordingly.. If you build Webchat manually from the rest of the component library, the on functions should work just fine.