Integrate Botuj Chatbot in Nuxt.js

Learn how to embed the Botuj chatbot in a Nuxt.js application.

To embed Botuj in a Nuxt.js application:

📥 Step 1: Get the Embed Script

In your Botuj dashboard:

<script
  defer
  src="https://cdn.botuj.pl/loader.js"
  data-key="${chatbotId}"
></script>

🧩 Step 2: Add to app.html (Nuxt 2)

  1. In your Nuxt project root, create or edit app.html
  2. Add the script before the closing </body> tag:
<body>
  {{ APP }}
  <script
    defer
    src="https://cdn.botuj.pl/loader.js"
    data-key="YOUR_CHATBOT_ID"
  ></script>
</body>

🧩 Nuxt 3 Option: Use a plugin

Create a plugin in plugins/botuj.client.js:

export default defineNuxtPlugin(() => {
  const script = document.createElement('script')
  script.defer = true
  script.src = 'https://cdn.botuj.pl/loader.js'
  script.dataset.key = 'YOUR_CHATBOT_ID'
  document.body.appendChild(script)
})

Register in nuxt.config.ts:

export default defineNuxtConfig({
  plugins: ['~/plugins/botuj.client.js']
})

✅ Your chatbot is now integrated into Nuxt!