To install an Agent on your website using the Bubble widget use the following code snippet:
Copy
<script type="module"> import Chatbox from 'https://cdn.mu.chat/embeds/dist/chatbox/index.js?v=2'; Chatbox.initBubble({ agentId: 'YOUR_AGENT_ID', });</script>
Replace YOUR_AGENT_ID with the ID of your Agent
Copy
<script type="module"> import Chatbox from 'https://cdn.mu.chat/embeds/dist/chatbox/index.js?v=2'; Chatbox.initBubble({ agentId: 'YOUR_AGENT_ID', });</script>
Replace YOUR_AGENT_ID with the ID of your Agent
Copy
// place it in the head tag of your index.html file.<script id="muchat-agent" type="module" dangerouslySetInnerHTML={{ __html: `import Chatbox from 'https://cdn.mu.chat/embeds/dist/chatbox/index.js?v=2'; Chatbox.initBubble({ agentId: 'YOUR_AGENT_ID', });` }}/>
Replace YOUR_AGENT_ID with the ID of your Agent
Copy
// app/layout.tsx or app/page.tsximport Script from 'next/script'export default function Layout({ children }) { return ( <> {children} <Script strategy="lazyOnload" type="module" dangerouslySetInnerHTML={{ __html: ` import Chatbox from 'https://cdn.mu.chat/embeds/dist/chatbox/index.js?v=2'; Chatbox.initBubble({ agentId: 'YOUR_AGENT_ID', }); ` }} /> </> )}