Elvin Custom Trigger API

This article describes the available API methods for controlling the Elvin widget. It explains how to open or close the widget, switch to specific sections, prefill or send messages, and optionally hide the default launcher during initialization. These options allow you to trigger Elvin from their own UI elements and manage how the widget behaves on the page.

API Methods

All methods are called using $productFruits.push():

Toggle Elvin Widget

$productFruits.push([
'do',
'toggle-elvin-widget',
{
state?: boolean,
section?: 'conversation'|'quick-links'|'newsfeed'|'human-handover'|'feedback',
focusId?: number|string
}
]);

Parameters

Parameter

Type

Required

Default

Description

state

boolean

No

-

If not provided, the call acts as toggle. If provided, it enforces the state

section

string

No

'conversation'

Which section of Elvin to open

focusId

number |
string

No

-

ID to open in some cases (e.g. particular article in quick-links or news item ID in newsfeed)

Valid section values:

  • conversation
  • quick-links
  • newsfeed
  • human-handover
  • feedback

Send Message to Elvin

$productFruits.push([
'do',
'send-message-to-elvin',
{
message: string,
sendImmediately?: boolean,
startNewTopic?: boolean
}
]);

Parameters

Parameter

Type

Required

Description

message

string

Yes

The user message

sendImmediately

boolean

No

If true, it will send it. If not, only the textarea for user input is filled in

startNewTopic

boolean

No

Start a new conversation, clearing the previous chat history

Note: To hide the default launcher, use the `hideElvinLauncher` init option. See Custom Initialization Options for details.


Was this article helpful?