Javascript API


When adding site_connect.js to your website you enable a lightweight publish/subscribe transport mechanism. The page contains a extremely lightweight message broker which allows one to route messages from publishers to multiple subscribers.

A Quick Overview

Messages are published to topics. All subscribers to a topic will get the message. A topic is a string, much like a file-path. For example "truck/001/temperature". A subscriber can directly subscribe to a topic, or use wildcards '+' and '#'. '+' matches exactly one word between the slashes, and '#' can be used at the end of a pattern to match all sub-topics.


Publish/Subscribe in

After loading // it is possible to subscribe and publish topics on your local page.

Host Page

All topics on the host page begin with the '~/' character. Messages published under this topic are not transferred to the site-connect frame and remain local.

Site-Connect Frame

The site connect scripts loads a separate frame which serves as a connection to the servers. When a customer agent starts a co-browse or chat session this frame is used to display the interface. Components can be loaded on demand during the lifetime of the host-page. During its lifetime messages can be published. Subscribers can subscribe to these messages by subscribing to the following set of topics.

Site-Connect Topics

Co-browsing Topics

Site-Connect Frame Handling Topics

Chat Button Topics

Javascript API

Stopping a Cobrowse Session.


It is possible to stop an ongoing cobrowse session by enforcing a stop. This function signals the communication frame, and stops sending page updates to the server. The cobrowsing session will stop and the agent is notified. When the session is stopped the ~pagesession/cobrowsing/stop message is published via the publish subscribe api.