Thanks friendofflore for your answer this really helped me out. At present There are definitely some contradictions in the documentation which doesn't make it entirely clear what you can and cannot do from lightning components.
I have just raised a similar question with the SF support team and your analysis is entirely correct at present.
r.e. Artem's question on Direct to button routing, my findings were also that this is not yet available from within a lightning component. If developers wish to do dynamic rendering of a buttonID based on data NOT available in the prechat form then they will need to copy the ‘getCode’ snippet in to a vf page, use vf remoting or something similar(possibly AJAX) in order to access server side data.
Once they have access to that data then they can then use direct to button routing accordingly E.g. if a customer is a high priority customer then send them to ‘x’ queue. This vf page will then need to be added to the community in replacement of the OOB community snap-in component.
e.g. (from within a vf page) invoke server side controller passing in the email address from the form as parameter to get details of contact that is not available in prechat form(that we don’t ask users to fill in)
embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
var email = prechatFormData[2].value;
Visualforce.remoting.Manager.invokeAction(
‘{!$RemoteAction.GenericControllerName.GenericGetContactMethod}’, email,
function(result, event){
if(result.HighValueAccount== true){
return buttonIdOfTheHighValueQueue
}
},
{escape: true}
);
};
We didn’t try this, but I believe it’s also possible to do remoting from within the snippetfile (Static resource) which would allow the snap in to sit at the bottom of the webpage/community rather than at the bottom of the vf page as really the creation of the vf page was only so we could access data via apex code to dynamically set the buttonId.