To toggle the virtual assistant, use:
cvjq(VAMD).trigger('va.toggle');
To launch the virtual assistant programatically using custom launch parameters e.g. entry string, use:
cvjq(VAMD).trigger('va.open', [{entry: 'Hi there!'}]);
To force the virtual assistant to open, use:
cvjq(VAMD).trigger('va.open');
To force the virtual assistant to close, use:
cvjq(VAMD).trigger('va.close');
You can pass additional launching parameters like business area and channel and they will be used throughout the VA session:
cvjq(VAMD).trigger('va.open', [{businessArea: 'Root.MyBA', Channel: 'Root.MyChan'}]);
Additionally you can assign launching parameters to vaStartupData data object and it will be used on VA startup. This object has to be present on the page before first request is made to the engine:
var vaStartupData = { businessArea: 'Root.MyCustBA', Channel: 'Root.MyCustChan', entry: 'Hello world!' }
If you need to re-render the template (old HTML will be removed and new one added), use:
cvjq(VAMD).trigger('va.re-render');