ruLog in to Senler

init reference

Start with initialization and configuration priority. This reference covers initial configuration. After startup, use the separate runtime parameters.

init Parameter Reference

The loader accepts only supported top-level keys:

KeyTypeRequired / defaultPurpose
channel_idstringRequiredWidget channel ID from the generated code.
userobjectOptionalVisitor data. Whenever external_id is supplied, it must have a server-generated user_hash.
themeobjectOptionalOverrides for appearance, popup dimensions, text, and the floating button. Unspecified fields come from channel settings.
featuresobjectOptionalChat feature overrides. Unspecified fields come from channel settings.
welcomeobjectOptionalGreeting type: mode: "centered_text" or mode: "automation_message" with the automation_id and node_id of an allowed channel message. Omit to inherit channel settings.
lang"ru" | "en" | "auto""auto"Interface language.
display_mode"popup" | "embedded""popup"Chat placement mode.
surfaceVisiblebooleantrueWhether the website container is visible, for read receipts. Update through updateRuntime for a hideable panel; this does not change its layout.
button_onlybooleanfalseA non-interactive floating button without a chat iframe. Incompatible with embedded.
containerCSS selector or DOM ElementRequired for embeddedEmbedded-widget container. Pass it at popup startup as well if you will switch modes through the Public API later.
shellobjectEmpty objectcollapse_button and mobile_edge_swipe; both are off until set to true.
onCollapsefunctionOptionalCallback for an embedded-widget collapse request.
onReadyfunctionOptionalCalled once after successful chat initialization; receives channel_id, display_mode, and button_only. In button_only mode, reports button readiness.
onErrorfunctionOptionalReceives the first startup failure: an Error with code, message, and retryable. See callback details.
contextProviderfunctionOptionalSynchronous provider of persistent page context.
resolveRuntimefunctionOptionalSynchronously selects the greeting and appearance using visitor facts and website conditions. Does not execute dialog commands.
pageElementActionsobjectOptionalexecute / clear adapter for controlling elements of an embedded application. Contract and example.
customActionsobjectEmpty setSite buttons and actions available in chat.
customActionsLanguage"ru" | "en"Not setDescription language for customActions.
debugbooleanfalseAdditional loader console messages.

Other top-level keys are errors. Calling SenlerWidget.init(...) again destroys the current instance and creates a new one, so use Public API methods for temporary changes.

Chat Features

features keyWhat it enablesDefault
file_uploadFile attachments.true
voice_messagesVoice-message recording.false
emojiEmoji picker.true
split_viewAt widths of 640 pixels and above, shows the dialog list beside the current chat.true
element_selectionSelecting an element on the host page for a question.false

The element_selection flag alone is not enough for stable references. Add data-ai-* markup so labels remain clear and elements can be found again.