• Release Notes
  • User
  • Admin
  • Developers
  • Integrations

›JS API

General

  • Overview
  • LiveView / CoBrowsing / Session Recordings

JS API

  • Overview
  • CoBrowsing
  • LiveView / Session Recordings
  • WebChat
  • Web Calling
  • Video Conference
  • Logging
  • User
  • Team
  • API
  • Supported Browsers
  • Supported Technologies

Android

  • Overview
  • Installation
  • Usage
  • Reference
  • Licenses

iOS

  • Overview
  • Installation
  • Usage
  • Reference
  • Licenses

Flutter

  • Overview
  • Installation
  • Usage
  • Reference

Capacitor

  • Overview
  • Installation
  • Usage
  • Reference

JavaScript API - LiveView / Session Recordings

Configuration

Learn how to configure the LiveView plugin. Go to Configuration

Basic

Manually trigger CoBrowsing events. For example start or stop the session manually.

Script loaded callback

When the JavaScript library is loaded asynchronously or deferred, it is necessary to check then script is initialized. Therefore it exists a global property CVLoaded. The global property CVLoaded is undefined when the script is not loaded and executed already. If it is undefined, a callback function can be set to the global propety. It will be called from the script when it is loaded.

Full example

function initFunction() {
    // your code
}

if (!window.CVLoaded) {
    window.CVLoaded = initFunction;
} else {
    initFunction();
}

Start Sharing

Start the cobrowsing/liveview session.

CV.liveview.startSharing();

Typical LiveView - Plugin Configuration

TypeValue
OptinSupport Agent / Visitor
Live Assistance Button(optional)

Stop Sharing

Stop the cobrowsing/liveview session.

CV.liveview.stopSharing();

Typical LiveView - Plugin Configuration

TypeValue
OptinSupport Agent / Visitor
Live Assistance Button(optional)

Optin

  1. Sets a flag in the LocalStorage of the browser that the user has opted in for session recordings (i.e. the user clicked the "accept cookies" button).
  2. Starts the LiveView session.
CV.liveview.optin();

Typical LiveView - Plugin Configuration

TypeValue
OptinSupport Agent / Visitor

Optout

  1. Stops the actual session.
  2. Sets a flag in the LocalStorage of the browser, that no LiveView session will be started until an optin is done.
CV.liveview.optout();

Typical LiveView - Plugin Configuration

TypeValue
OptinBy Function

Connection status

Returns a boolean value which shows if the LiveView/CoBrowsing session is active/connected.

CV.liveview.connected();

Restart the session

Restarts the whole CoBrowsing/LiveView session. If the session is not active, it gets started.

CV.liveview.restart();

Get Share Url

Returns the sharing URL. The share url is an absolute URL which you share to someone else. With this URL it is possible to join the session without login. The share url is only available if the setting "Allow Sharing" (Plugins -> LiveView -> Edit) is activated. Otherwise the function is not available.

CV.liveview.getShareUrl();

Typical LiveView - Plugin Configuration

TypeValue
Allow Sharingenabled
Optin(optional)
Bidirectional(optional)

Get Share Id

The share id is a unique 5 digits code (over all active sessions) which you can use to join the actual CoBrowsing/LiveView session. You can generate a public join url with the following REST API function : https://developers.chatvisor.com/#operation/getUrlOfSessionByShareIdUsingGET

CV.liveview.shareId();

Typical LiveView - Plugin Configuration

TypeValue
Optin(optional)

Get Session Id

The session id is a unique identifier to identify each session. You can generate a public join url with the following REST API function : https://developers.chatvisor.com/#operation/getUrlOfSessionBySessionIdUsingGET

CV.liveview.sessionId();

Custom

Custom Events

Send a custom event which is visible in your recording.

CV.liveview.event('<type>', '(optional) <value>');

Tagging

Tag a session with user id or any additional information.

CV.liveview.tag('<tag>');

Eventlistener

You can define your own listeners which are triggered at specific events.

Session started

It is triggered when the session starts.

CV.liveview.addSessionStartedListener(function() {});

Session stopped

It is triggered when the session stops.

CV.liveview.addSessionStoppedListener(function() {});

Session changed

It is triggered when the sessionId or the visitId is changed.

CV.liveview.addSessionChangedListener(function(event) {});

The datastructure of the event is { visitId: '<visitId>', sessionId: '<sessionId>', visitorId: '<visitorId>' }

Clear Session listener

Cleanup the added session listener to avoid memory leaks.

CV.liveview.clearListener();
← CoBrowsingWebChat →
  • Configuration
  • Basic
    • Script loaded callback
    • Start Sharing
    • Stop Sharing
    • Optin
    • Optout
    • Connection status
    • Restart the session
    • Get Share Url
    • Get Share Id
    • Get Session Id
  • Custom
    • Custom Events
    • Tagging
  • Eventlistener
    • Session started
    • Session stopped
    • Session changed
    • Clear Session listener
MANUALS
User Manual: Sales Suite
Admin Manual: Sales Suite
User Manual: Support Suite
Admin Manual: Support Suite
DEVELOPERS
Integrations
REST API
SDK API
LEGAL
Privacy Policy
Terms and Conditions
Imprint
Engage
Copyright © 2024 TeamViewer Austria GmbH