NexusConnectSDK. chat

Version:
  • 2.1

Methods


<static> start(skill)

Starts a chat - must be called before methods involving a web socket connection (`sendMessage`, `end`)

Parameters:
Name Type Argument Description
skill string

Skill group (e.g. 'sales') to connect to. Required unless you've implemented custom queuing.


<static> on(eventQuery, callback)

Subscribes to chat events

Parameters:
Name Type Argument Description
eventQuery string

An event query (e.g. `presence.agent` or `presence.agent.left`)

callback function

Callback to invoke when the event is emitted


<static> off(eventQuery, callback)

Unsubscribes from chat events

Parameters:
Name Type Argument Description
eventQuery string

An event query (e.g. `presence.agent`) used in `on()`

callback function

A callback function that was used in `on()`


<static> sendMessage(message)

Sends a chat message

Parameters:
Name Type Argument Description
message string

Message to send


<static> getSession()

Gets session data ('session ID', 'session device ID')


<static> end()

Ends chat and unsubscribes from all events