⚠️ Warning: Deprecated
The DDP methods outlined are deprecated. We are no longer actively testing or maintaining these methods, and their behavior may be unreliable or change without notice.
For new development and long-term support, we strongly recommend using the REST APIs instead. Avoid relying on DDP methods for critical functionality.
This API is intended to be used for having a Livechat conversation.
First, you need to generate a visitor token (it can be any random string).
Call
livechat:getInitialData
passingvisitorToken
as the first argument, the response will be an object containing a Livechat configuration object with the following properties:
Field | Type | Description |
---|---|---|
|
| Whether Livechat is enabled for that workspace or not. |
|
| The Livechat widget title. |
|
| The hexadecimal color of the Livechat widget title bar when Livechat is online. |
|
| If the registration form should be displayed or not.. |
|
| The current conversation room for the current guest user |
|
| The current guest user. |
|
| Array of Livechat triggers. |
|
| Array of Livechat departments. |
|
| If client-side department switching is allowed. |
|
| If there are Livechat agents online. |
|
| The hexadecimal color of the Livechat widget title bar when Livechat is offline. |
|
| The message that will be displayed on the Livechat offline form. |
|
| The message that will be displayed after sending a message using the offline form. |
|
| The message that will be displayed when Livechat is offline. |
|
| If the offline form will be displayed when Livechat is offline. |
|
| If the VideoCall feature is available. |
|
| The system message that will be sent to the current guest user when the conversation is closed. |
|
| If the name field is displayed on the Livechat registration form. |
|
| If the email field is displayed on the Livechat registration form. |
|
| The title of the widget when Livechat is offline. |
|
| The default user language to be set in the Livechat widget. |
|
| If the Livechat widget will ask the current guest user if they would like a transcript after the conversation is closed. |
|
| The message to be displayed when asking about the transcript. |
|
| The current agent attending the chart. |
Call livechat:registerGuest to register guests and get the response containing the visitor's data.
Before sending the first message, you have to generate a random
room _id
.Now you can send messages to the method sendMessageLivechat.
Subscribe to: stream-room-messages and
stream-livechat-room
.Get agent info by calling
livechat:getAgentData
.