New: Learny Brain for Sales & Support — an AI agent for your website.
Learny Brain

Public widget

The public widget lets any brain become an embeddable chat assistant that lives on your website. Visitors talk to it without signing in — it answers from that brain's indexed content and never reaches your connected apps.

What the widget is

A brain can be made publicly accessible and embedded with a single line of HTML. The widget resolves the brain globally by its public_id, so it works on any domain regardless of your workspace address. Visitors see a launcher (a floating bubble, a conversation-starter bar, or a hidden trigger), open the chat, and ask questions in plain language.

Public access is controlled

  • Master switch — in Widget settings, toggle Enable the public widget. When disabled, the widget returns a neutral 404 so outsiders can't distinguish "no brain" from "widget off".
  • Anonymous visitors get answers only — the widget answers from the brain's indexed content (SamePage, context URLs, and indexed connections). It can never open your live Notion, GitHub, or Jira.
  • Access belongs to managers/admins — only managers and admins can open widget settings.

Appearance & behavior

  • Launcher stylebubble (floating icon), bar (conversation-starter bar across the page bottom), or hidden (trigger via SDK).
  • Display modefloating (opens a panel over the page) or docked (slides out from the left or right edge).
  • Position — bottom-right, bottom-left, top-right, top-left, top-center, or bottom-center.
  • Purposesupport (accurate, step-by-step answers, escalates cleanly) or sales (warm greeting, qualifies needs, drives toward a next step).

When the launcher is a bar, you must provide at least one conversation starter (pre-filled question chips). The bar also supports lead-in text, alignment, and a close behavior (dismiss or minimize back to a bubble).

Branding the widget

Customize how it looks and sounds:

  • Accent color — light mode and accent color — dark mode — color the chips, button, and bubble background in each appearance. Pick a dark-mode accent that stays readable on dark backgrounds.
  • Default appearancelight, dark, or match visitor's system. This is what visitors see when your embed code doesn't specify a mode (legacy embeds always get this, so they render exactly as before — light, unless you change it).
  • Header title — shown at the top of the chat window (defaults to the brain name).
  • Greeting message — the opening line visitors see.
  • Launcher label — accessibility tooltip.
  • Font — a curated, alphabetized list of Google fonts (Archivo, Inter, Outfit, Space Grotesk, …) applied to the whole widget: chat window and starter bar. The picker shows each font in itself with a live preview.
  • Icon — pick from 15 preset icons or upload your own PNG, JPG, SVG, WEBP, GIF, or ICO.

The bar supports theme choices (light, dark, glass) and a lead-in line. Note: bar theme styles only the conversation-starter bar launcher — the chat window itself follows the light/dark appearance described below.

Light and dark appearance

The widget supports full light and dark modes — dark mode restyles the whole chat window (background, message bubbles, inputs, lead form), not just the accent color.

In dark mode the accent is used inversely: instead of coloring filled backgrounds (as in light mode), it becomes the foreground — header text and icons, the launcher icon, your messages, and buttons appear in the accent color on dark surfaces, delineated by a 1px accent border. So pick a dark-mode accent that reads well as text on a dark background (light, bright tones work best).

  • Per page: add data-theme="light|dark|auto" to the embed script (auto follows the visitor's OS prefers-color-scheme, live).
  • Google Tag Manager: GTM drops data-* attributes, so set window.LearnyBrainConfig.theme = "dark" (or "light"/"auto") instead.
  • From your own UI: call LearnyBrain.setTheme('dark') (or 'light'/'auto') any time; LearnyBrain.getTheme() returns the current mode and LearnyBrain.on('theme', fn) listens for changes.

Precedence: setTheme() > data-theme / LearnyBrainConfig.theme > the brain's default appearance. Anything unspecified falls back to light.

Installing the widget

Go to Widget settings for the brain. There are three install paths:

  1. Direct — paste the snippet (<script src=".../w/widget.js" data-brain="..." defer></script>) before </body>.
  2. Google Tag Manager — GTM drops the data-brain attribute when it re-injects, so use the GTM-safe snippet that passes the brain ID through window.LearnyBrainConfig.
  3. SDK trigger — set launcher_style to hidden and call LearnyBrain.open(), .close(), .toggle(), or .sendMessage('...') from your own UI.

The snippet always loads from the canonical widget host (brain.learny.co or equivalent) so it works for every org, including custom domains.

Domain restrictions (optional)

By default the widget is embeddable anywhere. To restrict it, list allowed domains (one per line) in widget settings — e.g. example.com or *.example.com. The server normalizes the list and expands wildcards. Empty = anywhere. The widget also sets a frame-ancestors CSP directive so browsers enforce the allowlist.

Context and URL scraping

A brain's widget answers from everything indexed into it, including URLs you add manually. In the brain's URLs section you can add pages, .txt or .md files, or a sitemap.xml. They're fetched and indexed automatically — when you add or re-scrape a source, and again on a daily schedule — so the widget finds them alongside SamePage content. Removing a source also removes everything indexed from it.

Each URL shows its last crawled time so you can see how fresh it is. Pressing Re-crawl all now re-crawls every source in the background — you can leave the page — and emails you a summary (sources, pages indexed, per-URL status) when it finishes.

Human handoff

Visitors can reach a person in three ways:

  • Agent escalation — the assistant can escalate mid-conversation (enabled per brain).
  • Lead capture — a "Talk to a human" form collects name, email, and message.
  • Auto transcript — when enabled, the full conversation is emailed to the configured handoff_email when it ends.

Handoffs are rate-limited to prevent abuse.

Follow-up suggestions

After an answer, the widget can propose 0–3 short follow-up question chips (enabled by default). These are grounded in the conversation turn and never break the chat. If the model call fails, no chips appear — the answer is never interrupted.

Security & anonymity

Visitors never log in: the widget uses short-lived signed tokens instead of accounts, and visitor conversations stay private — they never appear in your team's conversation lists.

SDK reference

When the snippet loads, it exposes window.LearnyBrain:

  • LearnyBrain.open(), .close(), .toggle()
  • LearnyBrain.sendMessage('...') — sends a message into the chat
  • LearnyBrain.setTheme('light'|'dark'|'auto'), .getTheme() — light/dark appearance
  • LearnyBrain.on('ready'|'open'|'close'|'theme', fn) — event listeners

Remember: anonymous widget visitors never reach your connected apps. The widget answers from indexed content only. For live tool access (Notion, GitHub, etc.), users must sign in as workspace members and chat from inside the workspace.