I have a chatbot based on Smooch.io and I am trying to show a menu on chat initialization so user can start from here instead of typing anything.
As far as I understand from the docs, to do that I need to create conversation Smooch.startConversation();
and then send stuff from my backend app. However it gives me "Smooch.startConversation();" error.
So my question is 1) What I am doing wrong here?; 2) Is there any other way to show initial menu instead of starting conversation without user yet messaging anything?
Assuming you're using the latest version of the SDK, you're probably calling
startConversation
before the SDK has finished initializing.You should wait for the promise returned by
init
to resolve before callingstartConversation
. Like this: