A simple custom HTML element for a chatbot.
You can install the realtorbots-ai
package via npm:
npm install realtorbots-ai
or use via unpkg:
<script src="https://unpkg.com/realtorbots-ai@latest/index.js"></script>
create a config.js file and paste your access token
const config = {
token: "<-- token -->",
};
paste the following in your html body
<chatbot-ai id="chatbot-ai"></chatbot-ai>
<!-- Load config.js and set the token -->
<script src="config.js"></script>
<!-- Load the chatbot element and set the token -->
<script>
document.addEventListener('DOMContentLoaded', function () {
const chatbotElement = document.getElementById('chatbot-ai');
if (chatbotElement && config.token) {
chatbotElement.setAttribute('token', config.token);
console.log("Chatbot element and token found.");
} else {
console.error('Chatbot element or token not found.');
}
});
</script>