Check out our Amazon Connect solution! Learn More

Updated support to Vonage's Video APIs

By callstats on January 26, 2021

Vonage's Voice and Video API

The Vonage Video API (formerly TokBox OpenTok) embeds interactive voice and video applications. The OpenTok.js integration with was updated recently, especially additional identifiers and custom events. The opensource javascript shim is hosted on GitHub.

Integration steps

Serve the callstats-opentok-shim from your website or from’s CDN, add file on your page after the callstats.js script. Please make sure to add them ahead of tokbox js

<script src=""></script>
<script src=""></script>
<script src=""></script>

Then, initialize like shown below:


Currently, the shim supportsAppID, AppSecret, SessionID, RemoteID,InitCallback,StatsCallback, andconfigParams. So, for example:

AppId: 834738451,
AppSecret: 'sOTjsJEfwPUGW4SRJI4BhbprGJ3lfO6Kp+:ixCX1P9mzNThlsW+YNLlb=',
SessionId: '1_eiTh54cMjNx4FNk-JkT15IXNTGtNnh8W03m0RwYTMxUMNMDyhU2gzMxezMXjaF0Mj0E-UH4'

Documentation forInitCallback,StatsCallback, andconfigParamscan be found in the API documentation - and

API For sending the media events:


Supported fabricEvents:

 const fabricEvents = {
    audioMute: 'audioMute',
   audioUnmute: 'audioUnmute',
   videoPause: 'videoPause',
   videoResume: 'videoResume',
   screenShareStart: 'screenShareStart',
   screenShareStop: 'screenShareStop',
   dominantSpeaker: 'dominantSpeaker',

API For sending the User Feedback:

let feedback = {
'overall': 2, // scale 1-5
'comment': 'user comments',