gentle-policeman-89141
08/26/2025, 9:37 AMwindow.botpress && window.botpress.initialized === true , then immediately sends an event to the bot on page load. However, even though this condition is met, sending the event sometimes throws an error "`Botpress webchat is not initialized. Please call botpress.init() before sending events.`" suggesting the bot isn't fully ready yet, even though initialized === true (window.botpress.init has been called upstream) and the global functions are available.
Question: Should there be a timing delay between when window.botpress.initialized === true and when the bot can actually receive events (ie is this intended)? Is there a better guard to detect when the bot is actually ready to receive events from my web app?
Potential Solutions I'm Considering:
1. Add a fixed delay (e.g., 500ms-1s) after initialized === true
2. Use a different condition to check if events can be sent
thanks in advance!gentle-policeman-89141
08/26/2025, 6:36 PM