Open dhee.ai web widget with a launcher intent?

63 Views Asked by At

I'm using dhee.ai widgets to take orders on my site. I've identified cases where I want to programattically launch the widget with certain user intents upfront. This should happen without user having to click on the bot icon.

How can I do that ?

1

There are 1 best solutions below

0
On BEST ANSWER

It can be done using a javascript call as below

var myIntent = 'yourIntentToBeServedOnStartup'
var myParams = {param1:value1} //optional
var phoneNum = '9999999999'

DheeChatWidget.launchWithIntent("Guest", phoneNum, language, myIntent, myParams);

An example HTML which uses a custom intent to launch, can be seen here https://github.com/DheeYantra/dhee-widget-examples/blob/main/src/main/resources/static/index.html