2 Replies
when i use Typebot.sendCommand(...)
its not triggering!
here is the code
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0/dist/web.js';
document.addEventListener("DOMContentLoaded", function () {
const card = document.querySelector('.eftpos-terminal'); // or use '#startChatCard' for ID
if (card) { card.addEventListener('click', function () { // Your custom action here' console.log('Card clicked!'); Typebot.sendCommand('eftpos-terminal');
// Example: trigger chatbot // window.TidioChatApi.open(); // (example for Tidio)
// Example: open a popup // document.getElementById("popup").style.display = "block"; }); } }); </script>
if (card) { card.addEventListener('click', function () { // Your custom action here' console.log('Card clicked!'); Typebot.sendCommand('eftpos-terminal');
// Example: trigger chatbot // window.TidioChatApi.open(); // (example for Tidio)
// Example: open a popup // document.getElementById("popup").style.display = "block"; }); } }); </script>
What is your Typebot init function?