Ruby gem for opentok api
Ruby JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
CHANGES * moving filestructure to match casing and foldernames Apr 11, 2011
README.textile Defer ownership of this gem to stijnster Oct 11, 2011



I will no longer be maintaining this gem. Please refer to as the authorative source for updates to this gem.

Thank you.



OpenTok is a free set of APIs from TokBox that enables websites to weave live group video communication into their online experience. With OpenTok you have the freedom and flexibility to create the most engaging web experience for your users. OpenTok is currently available as a JavaScript and ActionScript 3.0 library. Check out and for more information.

This is the official Opentok rubygem.


To install using bundler, add Opentok to you gemfile and run `bundle install`:

gem 'opentok'

To install as a regular gem just type `gem install opentok`

How it works

API-key and secret

Request your api-key and secret at You can use the staging environment for testing. The gem uses this staging environment by default.

Create a session

With the following code, you can generate a valid session_id.

@api_key = 0 # should be a number
@api_secret = ‘’ # should be a string
@location = ’localhost’ # give Opentok a hint on where you are running your application

@opentok = @api_key, @api_secret

session_id @opentok.create_session(host)

Create tokens

With the generated session_id, you can start generating tokens for each user.

opentok.generate_token :session_id => "#{session_id}"

Typically you would create one session_id and store it (in e.g. a setting) and share that session_id between all users.