Hi there,
I had an issue earlier today where my embeded Typebot was not loading and I was getting the error:
Error! Couldn't initiate the chat. ()
The issue was that I didn't have an apiHost set in my initStandard() call and the default was going to
https://chat.typebot.io/api/v1/typebots/Adding an apiHost of:
https://typebot.io fixed this.
This error came out of nowhere i.e. the chat was working on my site yesterday and stopped working today.
I'd like to set up some error handling so that if there's an error with the Typebot in future, I can show something else.
Is there anything in the HTML & Javascript library I could use to tell if there's an error with initialising the chat to prevent this happening in future?
The only solution I have come up with so far is to use querySelectors to parse the loaded data and if an error exists in the children - I show something else.
Thanks in advance!