Vonage Video API preview environment

The OpenTok preview environment provides access to pre-release and beta OpenTok features.

In order to use the preview environment, contact Vonage to get an API key and secret. Use this API key and API secret for testing features in the preview environment.

Creating a session using the OpenTok preview environment

Use the OpenTok API key and API secret provided to you for use in the OpenTok preview environment, instead of the standard OpenTok production environment.

You need to configure the OpenTok server-side SDK to use the preview environment. To do this, you need to provide an apiUrl parameter when initializing the OpenTok object with the server-side SDK. Set the apiUrl to "https://anvil-preview.opentok.com". Use the API key and secret provided for use in the preview environment.

You can then use the server SDK to generate a session that will use the preview environment.

See the following examples.

Node.js

var OpenTok = require('opentok'),
    apiUrl = 'https://anvil-preview.opentok.com',
    opentok = new OpenTok(apiKey, apiSecret, apiUrl);

Java

String apiUrl = "https://anvil-preview.opentok.com";
OpenTok opentok = new OpenTok(apiKey, apiSecret, apiUrl);

PHP

use OpenTok\OpenTok;

$options = array(
    'apiUrl' => 'https://anvil-preview.opentok.com'
);
$opentok = new OpenTok($apiKey, $apiSecret, $options);

Python

from opentok import OpenTok

api_url = 'https://anvil-preview.opentok.com'
opentok = OpenTok(api_key, api_secret, api_url)

Ruby

require "opentok"

api_url = "https://anvil-preview.opentok.com"
opentok = OpenTok::OpenTok.new api_key, api_secret, api_url

.NET

using OpenTokSDK;
// ...
string ApiUrl = "https://anvil-preview.opentok.com";
var OpenTok = new OpenTok(ApiKey, ApiSecret, ApiUrl);

REST API

If you are using the REST API to generate a session, use https://anvil-preview.opentok.com as the resource URL for the HTTP POST request. For details, see the OpenTok REST documentation for creating a session.

Using the client SDKs for the OpenTok preview environment

In a web-based application, load the OpenTok.js library using the preview build URL provided for your preview environment.

For Android and iOS apps, use the preview SDK packages provided for the preview program. If you need current preview build URLs, contact Vonage Support.