OyeChats
FeaturesSolutionsIntegrationsPricingDocsBlogContact us

Installing the widget

One script tag, any website. This page covers the snippet, where it goes, how loading works, and how to verify the install.

The snippet

Copy the snippet from Chatbots → Channels → Website (it arrives with your bot key already filled in) and paste it immediately before the closing </body> tag of every page where the widget should appear.

HTML
<script
  src="https://cdn.oyechats.com/oyechats-widget.js"
  data-bot-key="bot-6a427d4529b9"
></script>
AttributeRequiredPurpose
data-bot-keyYesIdentifies which chatbot to load. Public by design.
Everything else is configured server-side. Colours, copy, avatar, suggested questions, lead form, live chat and timings all live on the chatbot record and are fetched at load time. There are no other data attributes to set, and changing settings in the dashboard takes effect without editing your HTML.

Where to put it

  • Inside <body>, as the last element before </body>. The widget creates its own container element at load time.
  • On every page you want it on. A snippet in a shared footer, layout or template covers a whole site at once.
  • Once per page. Two copies of the script mount one widget, but the duplicate load is wasted bandwidth.
Not in <head>. The script needs a <body> to attach to. Placed in <head> it may run before the body exists and fail to mount.

How it loads

  1. It finds itself

    The loader locates its own <script> tag and reads data-bot-key.

  2. It mounts into a shadow root

    The UI renders inside a shadow DOM, so your site's CSS cannot leak in and the widget's CSS cannot leak out. It carries its own copy of its framework and does not touch your page's JavaScript.

  3. It fetches its configuration

    Appearance and behaviour come from a public settings endpoint keyed by your bot key. No account credentials are involved.

  4. It renders the launcher

    A floating button, bottom-right. The chat panel itself is only created when a visitor opens it.

Because the panel mounts on interaction rather than on page load, the widget contributes very little to your initial page weight.

Verifying the install

  • Load the page in a normal tab and look for the launcher in the bottom-right corner.
  • Open the console. Widget messages are prefixed [OyeChats]. Run OyeChats.diagnose() for a snapshot of version, mount state and resolved configuration.
  • The dashboard marks the chatbot as installed after the widget has bootstrapped from your real domain at least once. Dashboard previews, the demo page and localhost do not count.

Nothing appearing? Start with Troubleshooting.

Something here wrong or missing? Tell us and name this page. We will fix it.