Skip to content

Configuration

The widget's behavior is driven by a single config object. Its defaults are baked into the bundle at build time, and the host page can override any key at runtime.

Resolution priority

Lowest to highest (the top wins):

  1. Bundle defaults — build-time values baked in at build time.
  2. <script data-mz-*> — attributes on the loading tag.
  3. window.MZBOT_CONFIG = {…} — global object (set before the bundle loads).
  4. <html data-mz-theme> / <html data-mz-lang> — live attributes on <html> (theme and language; watched by a MutationObserver).
  5. MZBOT.setTheme(…) / setLang(…) / setTips(…) — JS API calls at runtime.

TIP

For embed modes (inline/static/overlay/button/offset) the priority is: <script data-mz-*>window.MZBOT_CONFIG → bundle defaults. For theme and language, two more top levels apply — the live <html> attribute and the JS API call. For tips the top level is MZBOT.setTips(...) (there is no live attribute).

Three ways to set config on the host

html
<!-- 1) loading-script attributes -->
<script src="bundle.min.js" data-mz-theme="dark" data-mz-accent="#0dbb52" defer></script>

<!-- 2) global object (before the bundle) -->
<script>window.MZBOT_CONFIG = { theme: 'dark', accent: '#0dbb52', bgColors: { light: ['#eef2ee'], dark: ['#1b2735'] } };</script>
<script src="bundle.min.js" defer></script>

<!-- 3) live theme attribute on <html> -->
<html data-mz-theme="dark">

Key reference

Identity & endpoints

KeyTypeDefaultDescription
USER_UUIDstringClient/bot identifier on the backend.
API_HOSTstringhttps://api.assistant.morze.techRouter HTTP endpoint.
WS_HOSTstringwss://api.assistant.morze.tech/ws/WebSocket endpoint.
bitrix24booleanfalseBitrix24 placement mode: forward portal auth on every /msg and /action.

Set at build time only

USER_UUID, API_HOST and WS_HOST are baked into the bundle on the Morze side and cannot be overridden from the host page — neither via data-mz-* attributes nor window.MZBOT_CONFIG.

lang — UI language

KeyValuesDefaultDescription
langru | enruLanguage of the whole widget interface: input placeholder, menu, statuses, error screens, aria-labels.

Like the theme, the language uses the extended priority chain (highest first): MZBOT.setLang(...)<html data-mz-lang> (live attribute) → window.MZBOT_CONFIG.lang<script data-mz-lang> → the bundled value → ru.

html
<html data-mz-lang="en">
<script src="bundle.min.js" data-mz-lang="en" defer></script>

See MZBOT.setLang() for details.

theme — visual theme

KeyValuesDefaultDescription
modelight | white | dark | autodarkColor scheme (auto follows the OS).
designdefault | glassdefaultDesign language on top of the theme; glass is accent-tinted glassmorphism (see Theming).
accentCSS color#9162e4Accent color — drives all themed elements.
patternnone | whisper | mesh | scales | bloom | cipher | prismwhisperSVG background pattern of the chat area.
patternOpacity0..10.05Pattern opacity.
patternScale0.25..41.3Pattern scale.
bgColorsarray of colors | CSS string | {light, dark}Custom chat background (see Theming).
bgAngledegrees160Gradient angle.
patternImageURLSeamless image overlay on top of the background.
patternImageOpacity0..11Image opacity.
patternImageSizepx | CSS background-sizeTile size.
msgAnimationbubble | unfurl | cascade | pop | breathebubbleIncoming-message animation.
glow.dark / glow.lightbooleanfalse / trueAccent glow per resolved theme.
glow.intensity0.1..50.2Glow strength.

Every background key (pattern, patternOpacity, patternScale, bgColors, bgAngle, patternImage, patternImageOpacity, patternImageSize) accepts either one value for both themes, or a { light, dark } map — the branch is picked by the active theme and re-applied whenever it switches. See One background per theme.

Details on the Theming page.

chat — layout & behavior

KeyValuesDefaultDescription
type1 | 011 = floating launcher button, 0 = strip header.
positionrb | lbrbCorner: right-bottom / left-bottom.
closedButtonblob | simplesimpleClosed-button style (only type:'1').
lockScrollMobilebooleantrueLock host scroll on mobile while open.
soundbooleanfalseMaster switch for the notify-sound feature. false also removes the menu item.
notifySoundURLhttps://cdn.morze.tech/notify.mp3Sound on incoming message while closed. '' disables.
voicebooleantrueMicrophone button (voice messages). false — no button, no recorder mounted.
attachmentsbooleantruePaperclip button (files). false — no button, no file input created.
messengersarray[telegram, vk]Messenger buttons that fan out around the launcher on hover.
inlinebooleanfalseInline mode — launcher in the page flow. Requires container.
containerCSS selectornullHost element to mount into (falls back to <body>).
button.shapecircle | squaresquareShape of the simple button (blob ignores it).
button.sizepx50Button size.
offset.x / offset.ypx44 / 8Open-card offset from the viewport edge.
staticbooleanfalseStatic docked mode. Requires container.
staticHeightpx | CSS length'100%'Static panel height.
staticMaxWidthpx | CSS length | nullnullStatic panel width cap.
overlay.enabledbooleanfalseMount the overlay surface.
overlay.startVisiblebooleanfalseOverlay launcher visible immediately.
overlay.positionrb | lbrbOverlay launcher corner.

Modes are covered in detail on the Embed modes page.

messengers[]

js
messengers: [
  { type: 'telegram',  url: 'https://t.me/morzetech' },
  { type: 'vk',        url: 'https://vk.com/morzetech' },
  { type: 'ok',        url: 'https://ok.ru/profile/574368901092' },
  { type: 'instagram', url: 'https://www.instagram.com/morzetech' },
  // custom: any messenger via an icon URL
  { type: 'viber', url: 'viber://chat?number=%2B7...', icon: 'https://cdn.example.com/viber.svg', color: '#7360F2', label: 'Viber' },
]
  • typewhatsapp | telegram | vk | max | ok | instagram have built-in icons and brand colors; any other type is custom and needs icon. Aliases: odnoklassnikiok, instainstagram. Case-insensitive.
  • url — link (opens in a new tab). color, icon, label are optional.
  • An empty array turns the feature off.

bot — bot personality

KeyTypeDefaultDescription
avatarURLhttps://cdn.morze.tech/morze-avatar-blue.pngBot avatar.
titlestring | language mapMorze AssistantOpen chat title.
titleClosedstring | language mapМогу вам помочьCaption on the closed button.
responseDelayms1200Artificial delay before revealing an incoming message ("typing…" shows during it). 0 disables.
tipsstring[] | language mapQuick-reply suggestions shown in an empty chat.

Any of these keys (except responseDelay) can be given as a per-language map, re-resolved whenever the language changes:

js
bot: {
  title: { ru: 'Morze Ассистент', en: 'Morze Assistant' },
  tips:  { ru: ['Тарифы', 'Кейсы'], en: ['Pricing', 'Case studies'] },
}

tips can also be set from the host page — via the data-mz-tips attribute, the window.MZBOT_CONFIG.tips key, or at runtime with MZBOT.setTips(). The other strings go through MZBOT.setBotContent().

Full data-mz-* attribute list

data-mz-theme            data-mz-design           data-mz-accent
data-mz-pattern
data-mz-msg-animation    data-mz-bg-colors        data-mz-bg-angle
data-mz-pattern-image    data-mz-pattern-image-opacity   data-mz-pattern-image-size
data-mz-container        data-mz-inline           data-mz-static
data-mz-static-height    data-mz-static-max-width
data-mz-overlay          data-mz-overlay-start-visible   data-mz-overlay-position
data-mz-sound            data-mz-voice            data-mz-attachments
data-mz-button-shape     data-mz-button-size
data-mz-offset-x         data-mz-offset-y
data-mz-lang             data-mz-tips

data-mz-bg-colors

Accepts a comma-separated color string: data-mz-bg-colors="#1b2735,#283e51,#0a1622".

-light / -dark suffixes

Any background attribute (data-mz-pattern, data-mz-pattern-opacity, data-mz-pattern-scale, data-mz-bg-colors, data-mz-bg-angle, data-mz-pattern-image*) can be set per theme: data-mz-bg-colors-light="…" + data-mz-bg-colors-dark="…". The suffix-less attribute stays the value for whichever theme you don't spell out.

data-mz-tips

Accepts a JSON array (data-mz-tips='["Pricing","Case studies"]'), or — if the value isn't valid JSON — a |-separated string (data-mz-tips="Pricing|Case studies").