Package Exports
- botfactory-conversation
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (botfactory-conversation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Projeto para o componente de conversa do botfactory, esse componente é iniciado em qualquer site, basta criar um elemento html no arquivo .html e colar o script abaixo ajustando as variáveis com o elemento html criado e, caso necessário, ajustando os parâmetros opcionais
<script>
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "http://pcbnu00010096.interno.senior.com.br:3001/bundle.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'botfactory-sdk'));
(function () {
window.onload = function () {
window.BotFactory.init({
appKey: 'fb8d3140-d4d9-4616-95eb-fb3a3c277f7b', //obrigatório - chave gerada pelo botfactory
element: document.getElementById('meudiv'), //obrigatório - elemento onde o messenger será renderizado
username: 'usuario', //opcional - identificador do usuário que está conversando com o bot
width: 300, //opcional - width da tela de conversa, quando conversando com o bot
height: 500 //opcional - height da tela de conversa, quando conversando com o bot
});
}
})();
</script>Para geração e disponibilização do bundle.js, os comandos são respectivamente:
webpack
node server.jsFoi criado um projeto sample onde no arquivo index.html é feita a importação do componente Botfactory-integration-sample-react