close search

Code Samples

Explore sample code on GitHub to jumpstart development and build your understanding of OpenTok. Feel free to copy and modify the source code in these for your own projects.

These samples are hosted on GitHub

We use GitHub repositories to make it easy to explore, copy, and modify our sample code. If you’re not familiar with how to clone or download a GitHub repo, check out this helpful article to learn how in a few minutes.

Simple client-server for web

These sample apps show how you can use the OpenTok Server SDKs to create sessions, generate tokens with those sessions, and then pass those values to a JavaScript client that can connect and conduct a group chat.

PHP Java
.NET Node
Ruby Python
Accelerator sample apps + extras

These client-side sample apps include much more functionality, with audio/video chat, user controls, CSS styling, and built-in text chat along with some starter code for screen sharing and archiving.

Web (JS) Web (React)
Android iOS

These sample apps show how you can use the OpenTok Server SDKs to archive (or record) sessions, list archives that have been created, download and delete the recordings. Also includes a simple client-side implementation.

PHP Java
.NET Node
Ruby Python
Mobile client samples

These repositories provide some examples and walkthroughs of different features and use-cases you can build with the OpenTok mobile client SDKs for Android and iOS (avilable in both Swift and Objective-C.)

Android iOS Swift
iOS Objective-C