RevoplyAIDocs
Website widget

Install the widget

Add the RevoplyAI chat widget to a website with one script tag, its attributes, or an iframe.

The website widget is a chat panel on your own site, answered by your assistant and your team like any other channel (channelType: web_widget). It ships as two parts:

  • embed.js, a small loader that draws the launcher button and creates the panel when a visitor opens it;
  • the panel itself, loaded in an iframe from widget.revoplyai.com only when it is first needed. A visitor who never opens the chat downloads only the loader and one small configuration request.

Script tag

Create a Web widget channel in the dashboard; its settings show the snippet with your channel id. Paste it before </body> on every page that should show the chat:

<script
  src="https://widget.revoplyai.com/embed.js"
  data-channel-id="YOUR_CHANNEL_ID"
  defer
></script>

Attributes

AttributeDefaultEffect
data-channel-idRequiredThe widget channel's id.
data-langThe browser's languageen or ar. Arabic also switches the panel to right-to-left.
data-positionbottom-rightbottom-right or bottom-left.
data-colorThe channel's colourThe launcher's colour until the channel's settings have loaded.
data-auto-openOffMilliseconds after which the panel opens by itself.
data-teaserOnfalse hides the greeting bubble next to the launcher.
data-teaser-delay6000Milliseconds before the greeting bubble appears.
data-launcherShownnone hides our button; open the panel from your own with the JavaScript API.

The brand colour, bot name, welcome message and suggested prompts come from the channel's settings in the dashboard; data-color only paints the launcher until they load. The launcher's position and auto-open are set by the attributes above alone.

Iframe

To place the panel yourself instead of using the launcher, frame it directly:

<iframe
  src="https://widget.revoplyai.com/YOUR_CHANNEL_ID"
  title="Chat"
  style="border: 0; width: 400px; height: 600px"
></iframe>

The iframe has no launcher, no greeting bubble and no JavaScript API. Use it on sites whose Content-Security-Policy forbids inline styles; see Security and CSP.

Behaviour worth knowing

  • A conversation is created on the visitor's first message, not on page load, so browsing never creates empty conversations in your inbox.
  • A visitor's session lasts 72 hours from their last activity, on that browser.
  • If the panel was open, it stays open as the visitor moves between pages of your site.
  • Replies arriving while the panel is closed show an unread badge on the launcher.

On this page