Cobrowse - Web SDK
The Cobrowse Agent SDK allows you to run the agent in different modes. If your customer does not wish to add the default Cobrowse Widget to their website, they can design their own agent interface and directly call our APIs.
Cobrowse supports the following different modes:
In-Session Widget (Mode 1)
The widget appears only during an active cobrowse session.
SDK (Mode 2)
The widget remains hidden, and only the End Session option will be displayed. This mode is recommended for chat and CRM integrations, where Cobrowse can be embedded within the system without showing the default widget.
Custom Widget (Mode 3)
No visible widget elements are provided. You can design your own UI while using our API methods in the background.
Starting a Cobrowse Session
Once the Session Key is created, use the following script to start a Cobrowse session.
<script>
var $zoho = $zoho || {};
$zoho.cobrowse = $zoho.cobrowse || {
config : {
code: 'Paste your widget code here',
domain: "assist.zoho.com",
mode: 2 // 1 - In session only Widget, 2 - sdk , 3 - custom widget.
}};
var d = document, s = d.createElement("script");
s.type = "text/javascript";
s.defer = true;
s.src = "https://" + $zoho.cobrowse.config.domain + "/cobrowsewidget";
s.onload = () => {
$zoho.cobrowse.sessionObject = $zoho.cobrowse.startSession(492091,"Malcom","Paste your widget code here")
}
var t = d.getElementsByTagName("script")[0];
t.parentNode.insertBefore(s, t);</script>
This returns a Promise object that can be used to manage the session.
$zoho.cobrowse.sessionObject.then(obj => {
// Get participants
const participants = obj.getParticipantList(); //
End session
obj.endSession();
});
How to create session key using OAuth Scope API
To learn how to create a session key using the API, click here.
Request
curl --location --request POST 'https://assist.zoho.com/api/v2/session?type=cb' --header 'Authorization: Zoho-oauthtoken {access_token}'
Response
{
"resource_type": "session",
"representation": {
"technician_url": "https://assist.zoho.com/cobrowse/?x-com-zoho-assist-orgid={zsoid}",
"session_id": "60****"
}
}