Integration Guide

Embed Showdini
anywhere in minutes

One script tag, one function call. All patterns below are live — click the buttons to see each mode in action.

Setup

Add the script

Paste this before </body>. Everything else is configured in JavaScript.

<!-- Add once, anywhere on the page -->
<script src="https://embedded.showdini.ai/showdini-embed.js"></script>

Pattern 1

Button → modal

The simplest integration. Pass a trigger selector and the widget opens a centered overlay when that element is clicked.

Live demo
<button id="demo-btn">Watch Demo</button>

<script>
Showdini.init({
  demoId: "YOUR_DEMO_ID",
  trigger: "#demo-btn",
});
</script>
Pattern 2

Multiple triggers, one modal

Pass an array of selectors or elements. All of them open the same single overlay — great for nav CTA, hero button, and mid-page banner sharing one instance.

Live demo — any button opens it
Showdini.init({
  demoId: "YOUR_DEMO_ID",
  trigger: [
    "#nav-cta",
    "#hero-btn",
    "#learn-more",
  ],
});
Pattern 3

Inline embed

Provide a container and the widget renders inside it. Without a trigger, it loads automatically when the container scrolls into view. Starting the call expands it to fullscreen; ending collapses it back.

Live demo
<div id="demo-inline-basic" style="width:100%; height:420px"></div>

<script>
Showdini.init({
  demoId: "YOUR_DEMO_ID",
  container: "#demo-inline-basic",
});
</script>
Pattern 4

Inline + trigger (deferred load)

Combine container and trigger. The iframe won't load until the button is clicked — useful for below-the-fold sections where you don't want to prefetch the demo on every page load.

Click the button to load
<button id="load-btn">Load Demo</button>
<div id="demo-inline-trigger"></div>

<script>
Showdini.init({
  demoId: "YOUR_DEMO_ID",
  container: "#demo-inline-trigger",
  trigger: "#inline-trigger-btn",
});
</script>
Pattern 5

Inline + browser chrome

Add browserFrame: { urlTitle: "…" } to show a macOS-style browser bar (traffic lights + address bar) above the inline embed. Makes the widget look like a live browser window showing your product. The chrome hides automatically when the call expands to fullscreen.

Showdini.init({
  demoId: "YOUR_DEMO_ID",
  container: "#demo-chrome",
  browserFrame: { urlTitle: "your-site.com" },
});
Pattern 6

Custom modal size

Override the default width and height (both default to 95%). These apply to the fullscreen modal — useful if you want a fixed pixel size or a narrower viewport.

700 × 560 modal
Showdini.init({
  demoId: "YOUR_DEMO_ID",
  trigger: "#demo-btn",
  width:  "700px",
  height: "560px",
});
Pattern 7

Programmatic API

Showdini.init() returns an instance with open() and close() methods, so you can control the widget from your own event handlers, timers, or UI framework.

Control from JS
// No trigger — controlled entirely via API
const demo = Showdini.init({
  demoId: "YOUR_DEMO_ID",
});

document.getElementById("open-btn")
  .addEventListener("click", () => demo.open());

document.getElementById("close-btn")
  .addEventListener("click", () => demo.close());
Pattern 8

Ask bar

launcher renders a text bar on your page — focusing it opens the demo. The bar collects no text itself; it hands the visitor straight to the agent. Give placeholder several questions and they type themselves out in turn. Pass mount to sit the bar in the page flow, as below, or omit it to float the bar over the page — a floating bar steps aside on its own while the demo has the screen.

Mounted in the page flow
Showdini.init({
  demoId: "YOUR_DEMO_ID",
  launcher: {
    mount: "#ask-bar",
    ctaLabel: "Instant chat",
    placeholder: [
      "What does it cost?",
      "Show me how it works",
    ],
  },
});

// Omit `mount` and the bar floats — `position`
// puts it bottom-center, -left or -right.

Reference

All options

Full list of Showdini.init(options) parameters.

Option Type Default Description
demoId
required
string — Your Showdini demo ID, found in the dashboard.
trigger string | Element | array undefined Selector(s) or Element(s) that open the demo on click. In inline mode, defers loading until clicked.
closeTrigger string | Element | array undefined Element(s) that close / collapse the demo when clicked.
container string | Element undefined Mounts the demo inline inside this element. Omit for modal mode. The lobby renders here; starting the call expands to fullscreen modal.
browserFrame { urlTitle?: string } undefined Inline mode only. Shows a macOS-style browser chrome (traffic lights + address bar) above the embed. urlTitle sets the address bar text — defaults to the current page hostname. Hidden when the call expands to modal.
width string "95%" Width of the expanded modal. Accepts any CSS value ("800px", "80%", etc.). On screens ≤ 720 px the modal always fills the viewport.
height string "95%" Height of the expanded modal. Same rules as width.
launcher boolean | object undefined Renders an ask bar on your page — see Pattern 8. Pass true for defaults, or an object: mount (place it in the page flow), position ("bottom-center", "bottom-left", "bottom-right" — floating only), placeholder (a question or a list of them), ctaLabel, logoUrl, buttonColor, buttonTextColor, theme ("light" or "dark") and dismissible (adds a close button; remembered for the browsing session).
lang string "en" Two-letter code for the language the agent greets visitors in. en speaks with a British accent; use en-AU for Australian.
showLanguageSelector boolean false Lets visitors pick the language themselves on the start screen.
metadata Record<string, string> undefined Your own data attached to the demo session — campaign attribution, CRM record ids, partner codes. Surfaces on the lead in the dashboard, the new-lead email and the lead.report_generated webhook.
forwardPageParams boolean false Also captures well-known tracking parameters (utm_*, gclid, …) from your page's URL into metadata. Off by default, since your query string is your data. Explicit metadata keys win.

Instance API

Showdini.init() returns ShowdiniInstance | undefined.

Method Description
open() Opens the modal (modal mode) or loads the inline lobby (inline mode). No-op if already open.
close() Closes the modal and resets the iframe so the next open starts a fresh session. In inline mode, collapses the expanded call back to the lobby.
destroy() Takes the widget off the page entirely — its DOM, its event listeners and its ask bar. Call this when the view holding the demo unmounts, so single-page apps do not leave listeners behind.