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 (widget.config.js), and the host page can override any key at runtime.

Resolution priority

Lowest to highest (the top wins):

  1. widget.config.js — build-time defaults baked into the bundle.
  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> — live attribute on <html> (theme only; watched by a MutationObserver).
  5. MZBOT.setTheme(…) — JS API calls at runtime.

TIP

For embed modes (inline/static/overlay/button/offset) the priority is: <script data-mz-*>window.MZBOT_CONFIGwidget.config.js. For theme, two more top levels apply — <html data-mz-theme> and MZBOT.setTheme(...).

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: { mode: 'dark' }, chat: { position: 'lb' } };</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.

Default points at production

For local development against morzebot-backend-v2 (:9000), override API_HOST/WS_HOST (local variants are commented in widget.config.js).

theme — visual theme

KeyValuesDefaultDescription
modelight | white | dark | autodarkColor scheme (auto follows the OS).
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 stringCustom 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.

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.
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' },
  // 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 have built-in icons and brand colors; any other type is custom and needs icon.
  • 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.
titlestringMorze AssistantOpen chat title.
titleClosedstringМогу вам помочьCaption on the closed button.
responseDelayms1200Artificial delay before revealing an incoming message ("typing…" shows during it). 0 disables.
tipsstring[]Quick-reply suggestions.

Full data-mz-* attribute list

data-mz-theme            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-button-shape     data-mz-button-size
data-mz-offset-x         data-mz-offset-y

data-mz-bg-colors

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