How to add an AI chatbot to Vue

On Vue, a chat widget is installed through index.html, before the closing </body> tag. Applies on your next build and deploy. None.

Where it goes

index.html, before the closing </body> tag

Availability: None.

Adding the chatbot to Vue

  1. 1

    Open index.html at your project root (public/index.html on Vue CLI projects).

  2. 2

    Paste the snippet before the closing </body> tag.

  3. 3

    Rebuild and deploy.

  4. 4

    Applies on your next build and deploy.

The snippet you paste

<script src="https://rubyrep.com/rubyrep.js" data-rubyrep="rr_your_public_key" defer></script>

Your own key replaces rr_your_public_key — you get it after training RubyRep on your site.

Worth knowing on Vue

  • Keep the script out of components so Vue's reactivity system never touches the widget's DOM.

  • With Vue Router in history mode the widget persists across navigation without remounting.

Vue questions

Where does the code go on Vue?
index.html, before the closing </body> tag. Applies on your next build and deploy.
Do I need a paid Vue plan?
None.
Will a Vue update remove it?
Keep the script out of components so Vue's reactivity system never touches the widget's DOM.
Does it slow Vue down?
No measurable effect. The snippet is deferred, so it loads after your page has rendered, and the chat interface itself is only fetched when a visitor opens it.

Related

Get your snippet.

Enter your Vue site and RubyRep reads it, builds your representative, and hands you the exact line to paste.

https://

Takes about a minute. No credit card.

Using something else? See all platforms.