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 |
|---|---|---|---|---|
|
| No | - | If not provided, the call acts as toggle. If provided, it enforces the state |
|
| No |
| Which section of Elvin to open |
|
| No | - | ID to open in some cases (e.g. particular article in quick-links or news item ID in newsfeed) |
Valid section values:
conversationquick-linksnewsfeedhuman-handoverfeedback
Send Message to Elvin
$productFruits.push([
'do',
'send-message-to-elvin',
{
message: string,
sendImmediately?: boolean,
startNewTopic?: boolean
}
]);
Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
|
| Yes | The user message |
|
| No | If true, it will send it. If not, only the textarea for user input is filled in |
|
| 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.