Skip to content
repliyo

Installation

Add the repliyo widget to any website with a single script tag — plain HTML, JavaScript, Next.js or Angular.

The script tag

The widget is a single vanilla JavaScript file with no dependencies. Paste the script tag anywhere before the closing </body> tag.

index.html
<!-- Add before </body> -->
<script
  src="<script URL from your dashboard>"
  data-key="pk_live_your_key"
  data-api="<API URL from your dashboard>"
  data-ws="<WebSocket URL from your dashboard>"
  async
></script>

Copy the ready-made snippet from your dashboard (API Key page) rather than typing this out: it fills in your real key and the correct script, API and WebSocket URLs. The placeholders above show its shape.

That's the whole install for most sites. Website builders and CMS platforms usually have a spot for custom HTML or scripts in their theme or site settings, so you don't need to touch backend code.


JavaScript frameworks

The dashboard's install panel has tabs for plain HTML, JavaScript, Next.js and Angular. They all load the same script with the same attributes; only the way the tag is added differs.

app/layout.tsx (Next.js)
// app/layout.tsx
import Script from 'next/script';

// ...inside <body>, after {children}:
<Script
  src="<script URL from your dashboard>"
  data-key="pk_live_your_key"
  data-api="<API URL from your dashboard>"
  data-ws="<WebSocket URL from your dashboard>"
  strategy="afterInteractive"
/>

The widget reads its attributes from its own script tag, so keep data-key on the element that loads it. Every attribute is listed in the SDK reference.


What happens once it's installed

  • •The widget shows a launcher button using the look you set under Appearance.
  • •It connects to repliyo when a visitor first opens the chat, not on page load.
  • •It keeps a visitor’s session in the browser’s localStorage, so the conversation survives a page refresh.
  • •Replies appear in the widget as Markdown-formatted text, with source chips when an answer came from your documents.

Restricting where the widget loads

On the API Key page you can list the domains allowed to use your key — bare hostnames such as shop.example.com, or a wildcard like *.example.com, up to 20. Leave the list empty and the key works from anywhere. See Authentication.


Next

The widget will load, but it can't answer much until you give it something to answer from. Continue with Connect your API for live data or Custom questions for documents.

We use essential cookies to run this site, and analytics cookies to understand how visitors use it. Analytics only loads if you accept. Learn more