Chat Widget methods

The following are methods for controlling the chat widget:

mount & demount

Mount or demount the widget from the window.

mountdemount
Copy
Copied
SinchSdk.Chat.mount({configuration})
Copy
Copied
SinchSdk.Chat.demount()

open & close & toggle

Open or close the chat window or configure it so it can be toggled.

openclosetoggle
Copy
Copied
SinchSdk.Chat.open()
Copy
Copied
SinchSdk.Chat.close()
Copy
Copied
SinchSdk.Chat.toggle()

send

Send a message over the chat widget.

Copy
Copied
SinchSdk.Chat.send("text")

Cleaning up the SDK storage data

The user session along with certain configuration parameters is stored in the browser storage. If you want to clear it, use:

Copy
Copied
SinchSdk.clear()

Terminating the SDK

When you are finished with the SDK, clear the SDK memory including the saved token for authorization with the following method:

Copy
Copied
SinchSdk.terminate()
We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.