coview

Javascript API

Introduction

You can interact with the coview on your webpage by calling the JavaScript functions below.

start

Starts coview on the current page with your initial properties. These have to include your projectKey
How to add the coview snippet

coview('start', {
  projectKey:'0123456789A'
});

clearSession

Clears the current user session. This is useful when a user logs out of your application and should not see his previous conversations. This will also stop coview on the current page.

coview('clearSession');

stop

Stop coview on the current page

coview('stop')

updateUser

In case, you have all available user information before injecting coview, you might use the user setting, which will let coview identify your user.

If you want to send identification informations afterwards, you can call updateUser anytime

coview("updateUser", {email:<string>, id:<string>, name:<string>})

showChatButton

For default, the coview chat icon is displayed on your webpage, so you don't have to call this function in the regular case.
If you disable the chat.showButton property within your page settings, the coview icon is hidden on startup. With this method, you can manually trigger coview to show the chat icon whenever you want. Afterwards, the coview launcher behaves like the chat.showButton is set to true (if you want to reset coview again, please see coview("hideChatButton") below).

coview("showChatButton")

Note

If the user has unread messages or recieves a new message from an agent, the chat button with the message notification appears until the user opens the conversation. When he closes the chat or reloads the page, the icon will disappear.

hideChatButton

The chat button and all it's widget will be hidden, this is equal to set the chat.showButton property to false in the coview settings.

coview("hideChatButton")

openWidget

Calling this method leads to one of the following cases:

  • The chat window opens, if and only if the customer has an ongoing conversation with an agent
  • The feedback widget opens, having the possibility to start a conversation, create selections, screenshots or screencasts.

The same behavior is given, when the user clicks on the chat icon.

coview("openWidget")

More infos:

closeWidget

This will trigger coview to close the current widget. If the chat.showButton property is disabled, the chat button will be hidden, as long as the client doesn't have an ongoing request. Calling this method is equivalent to the functionality, when the user closes the current widget on his own.

coview("closeWidget")

screenshot

Opens the screenshot widget, which allows the user to create a screenshot, having the possibility to add selections or cut out sensitive data. This is equal to the case, when an agent requests a screenshot during a conversation.

coview("screenshot")

screencast

Opens the screencast widget, which allows the user to record a screencast. Multiple pages or reloads will be recorded as well until the user stops the session. If there is already a conversation, the screencast will immedetially be send to the agent.

coview("screencast")

select

Displays a selection with the given selectionId. If the selection is on another page, the browser gets redirected and the selection will be displayed.

coview("select", <selectionId:string>)