Skip to Content
BetterFeedback Docs

Configure the embed

The four layers of embed configuration, their precedence, and every option the element accepts, rendered from the descriptor the widget itself reads.

Four layers, each an escape hatch for the one below. Most pages stop at the second.

  1. Defaults, in the tables below.
  2. Stored appearance on the survey, the same keys as the JS object. BetterFeedback sets it on the survey on request, and every link and embed of that survey inherits it.
  3. Attributes or the JavaScript API. data-* on the script tag, attributes on the element, or betterfeedback("config", { accent: "#e11d48", copy: { startButton: "Begin" } }).
  4. Host CSS. betterfeedback-widget { --bf-accent: red }. Always wins; it is the most explicit statement of intent on the page.

Precedence, lowest to highest:

defaults  <  stored appearance  <  attributes / JS config  <  host-page CSS

theme, copy and context merge key by key, so overriding one entry keeps the rest. The identity options survey, origin and target are never read from stored appearance or from a link; email and context are never read from stored appearance or from a ?c= link.

Every table on this page is rendered from the descriptor the widget is built from, copied into this site at a recorded commit. A page cannot list an option the widget does not have.

How to write a value

Each option is an attribute on <betterfeedback-widget>; on the script tag, prefix it with data-. A bare boolean attribute (auto-height) means true. Object options take JSON: data-theme='{"bubble-user-bg":"#eef"}'. An invalid value falls back to the default and never breaks the page; a number above its cap is clamped.

"Settable from" says which layers may set the option: stored is the survey's stored appearance, attribute / JS only means the embed code, and per session means the value lives with one visit and is never stored or shared.

Identity

AttributeJS keyTypeDefaultSettable fromWhat it does
surveysurveystringnoneattribute / JS onlyThe survey's public id, the last segment of its /s/ link.
originoriginstringnoneattribute / JS onlyOrigin of the conversation app. The loader sets it from its own script URL; set it only behind a proxy.
targettargetstringnoneattribute / JS onlyCSS selector of the element to render into. Implies inline mode. Without it the widget floats in a corner.

Layout

AttributeJS keyTypeDefaultSettable fromWhat it does
modemodefloating · inlinefloatingattribute / JS / storedfloating: a launcher opens a panel. inline: the conversation fills its container and is always open.
auto-heightautoHeightbooleanfalseattribute / JS / storedInline only. The frame grows and shrinks with the conversation instead of scrolling inside a fixed height.
min-heightminHeightinteger, at most 4096320attribute / JS / storedPixels. Lower bound for auto height.
max-heightmaxHeightinteger, at most 4096900attribute / JS / storedPixels. Upper bound for auto height.

Theme

Shorthands for the most common tokens, plus the theme and copy objects. Theming lists every token and copy key.

AttributeJS keyTypeDefaultSettable fromWhat it does
color-schemecolorSchemelight · dark · autolightattribute / JS / storedLight, dark, or follow the visitor's system setting.
accentaccentCSS value#191918attribute / JS / storedButtons, the launcher and the focus ring. Any CSS colour.
radiusradiusCSS value16pxattribute / JS / storedCorner radius of bubbles and the panel.
fontfontCSS valuenoneattribute / JS / storedCSS font-family stack. Pair with Font URL when the face is not installed.
font-urlfontUrlhttps URLnoneattribute / JS / storedhttps stylesheet that declares the font, for example a Google Fonts link. Its font files must allow cross-origin loading.
themethemeJSON object, token to CSS valuenoneattribute / JS / storedJSON object of token name to CSS value, for every --bf-* token. Overrides the shorthands above.
copycopyJSON object, copy key to textnoneattribute / JS / storedJSON object of UI string overrides, by copy key.
avatar-urlavatarUrlhttps URLnoneattribute / JS / storedhttps image for the agent avatar, or none to hide it. Empty keeps the default.

Launcher

Floating mode only. Behaviour says what each mode does.

AttributeJS keyTypeDefaultSettable fromWhat it does
launcherlauncherchat · mic · nonechatattribute / JS / storedchat, mic or none. Floating mode only. Replace the whole button with the launcher slot.
launcher-labellauncherLabelstringnoneattribute / JS / storedText next to the icon. Empty shows the icon alone.
positionpositionbottom-right · bottom-leftbottom-rightattribute / JS / storedWhich bottom corner the launcher sits in.
offset-xoffsetXinteger, at most 51220attribute / JS / storedPixels from the side edge.
offset-yoffsetYinteger, at most 51220attribute / JS / storedPixels from the bottom edge.

Behaviour

AttributeJS keyTypeDefaultSettable fromWhat it does
open-on-loadopenOnLoadbooleanfalseattribute / JS / storedFloating mode: open the panel as soon as the page loads.
trigger-selectortriggerSelectorstringnoneattribute / JS / storedCSS selector; clicking any matching element on the host page toggles the panel.
voicevoicebooleantrueattribute / JS / storedfalse removes the Talk button and the microphone permission from the frame: a text-only conversation. Set before mount.
auto-startautoStartbooleanfalseattribute / JS / storedSkip the Start screen: the conversation opens as soon as the frame loads, with the welcome message above it. It opens in text mode; voice still waits for the Talk button.

Session

What your page already knows about the visitor. Respondent context covers the limits and what the agent does with it.

AttributeJS keyTypeDefaultSettable fromWhat it does
emailemailemail addressnoneattribute / JS only, per sessionThe visitor's address when your page collected it first. Handed to the agent as unverified host data; never stored on the survey, never read from a ?c= link.
contextcontextJSON object, key to textnoneattribute / JS only, per sessionJSON object of short strings about the visitor (plan, seats, company). The agent confirms what it already knows instead of asking. Unverified host data; 24 keys, 4KB.

On this page