robinchatjs
v1.2.8
Published
Install the package via npm:
Downloads
90
Readme
RobinChatJS
Installation
Install the package via npm:
npm install robinchatjs
Implementation
Add the following script tag to your HTML file:
<script src="dist/chatComponent.js"></script>
<script>
const apiKey = 'APIKEY'; // Define your API key
const folderId = 'FOLDERID'; // Define your folderId
const link = "srcIcon";
const chat = new ChatComponent(apiKey, folderId, 'Robin assistant', link);
chat.init();
</script>
Constructor
The ChatComponent
constructor accepts the following parameters:
apiKey
(String): Your API key.folderId
(String): Your folder ID.title
(String): Title for the chat (default is 'Chat').link
(String): Link to an image.options
(Object): Additional options (default values are provided).
Options
ChatWidth
(String): Width of the chat component (default: '500px').messageHeight
(String): Height of messages area (default: '300px').questionColor
(String): Color of the user's question text (default: '#000').answerColor
(String): Color of the assistant's answer text (default: '#000').sendButtonColor
(String): Color of the send button (default: '#7977ff').ChatColor
(String): Background color of the chat component (default: '#f8f9fa').questionColorContent
(String): Background color of user's question box (default: '#e8fcf4').answerColorContent
(String): Background color of assistant's answer box (default: '#cfe2ff').iconDeleteColor
(String): Color of delete icon (default: '#f46a6a').
Description
This library facilitates integration with the RobinIA Solutions endpoint by providing a chat interface.