Initializes chat service and establishes socket.io connection with CTLive server.
Parameters:
Name | Mandatory | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
myself |
|
| An object containing user credentials to perform authenticationinfo. |
Returns:
Type | Description |
---|---|
JS Promise | An empty Javascript Promise |
Example:
Code Block | ||
---|---|---|
| ||
var myself = { "nickname": "Agent1", "isAgent": true, "id": "USER_AGENT1", "channel": "web" } LIVECHAT.login(myself) .then(function() { console.log("[CTLIVE] Initialization completed successfully"); }) .catch(function() { console.log("[CTLIVE] [ERROR] Initialization failed"); }); |