Suggestions

close search

OpenTok.js

The OpenTok.js library lets you use OpenTok-powered video sessions on the web.
API referenceTutorialsRelease notes

This page covers the following topics:


Overview

All OpenTok applications are composed of two parts:

The client SDK for building web-based OpenTok applications is OpenTok.js. This JavaScript library provides most of the core functionality for your app, including:

Client SDKs are also available for iOS and Android. All OpenTok client SDKs can interact with one another. You can learn more about the basics of OpenTok clients, servers, sessions and more on our OpenTok Basics page.

Building with OpenTok.js

The best way to learn how to use the OpenTok.js library is to follow our Basic Video Chat tutorial for web:

View tutorial

Once you understand the basics of building with OpenTok.js, you can get more detailed information and learn how to customize your application with our Developer Guides. To investigate specific API classes and methods, you can review the OpenTok.js Reference.

Loading OpenTok.js

To load OpenTok.js in your web page, add the following script tag:

<script src="https://static.opentok.com/v2/js/opentok.min.js"></script>

You can also install OpenTok.js using the @opentok/client npm package.

The current version of the OpenTok.js library can interoperate with OpenTok apps written with version 2.10+ of the OpenTok client SDKs:

Browser support

The OpenTok.js library is currently supported in:

OpenTok version numbers

You can include the OpenTok.js library in your web page using a <script> tag:

<script src="https://static.opentok.com/v2/js/opentok.min.js"></script>

The OpenTok.js version number consists of three parts: