Video Client SDK Changes from OpenTok to Unified Video Client SDK Changes from OpenTok to Unified

Video Client SDK Changes from OpenTok to Unified

Yukari Dumburs

Objective

This article explains the changes required when migrating Client SDKs from the OpenTok environment to the Unified environment. For an overview of the complete migration process, please refer to this article.

Applies To

  • Video API customers planning to migrate from the OpenTok environment to the Unified environment
  • Video Client SDK

Procedure

The latest OpenTok Client SDKs continue to work with Unified Application ID, Session ID, and Token. Migrating to the Unified-branded packages is recommended, but not required for the migration itself. As a result, you have two migration options

  1. Continue using the OpenTok Client SDK with Unified Application ID, Session ID, and Token, or
  2. Migrate to the Unified Client SDK.

The following sections describe each migration option.

Option 1: Continue using the OpenTok Client SDK

  1. If you choose to continue using the OpenTok Client SDK, first upgrade to the latest version. Unified session support was introduced in the 2.29.6. For the latest versions of each OpenTok Client SDK, please refer to the corresponding release notes below.
  2. Replace your Project Key with your Application ID when initializing the SDK.
  3. Ensure your application uses Session IDs and Token generated for your Unified application.

Option 2: Migrate to the Unified Server SDK

  1. If you choose to migrate to the Unified Video Client SDK, the first step in the Client SDK migration is to update your project configuration so that it points to the Unified Client SDKs. The following table summarizes the changes:
SDK Changes
JavaScript (Web Client SDK)

If you are loading the SDK via a Script tag, update it from:

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

to:

<script src="https://video.standard.vonage.com/v2/js/opentok.min.js"></script>

If you are using npm, update your dependency from:

@opentok/client

to:

@vonage/client-sdk-video
Android

Gradle dependency changes from:

implementation "com.opentok.android:opentok-android-sdk:2.30.1"

to:

implementation "com.vonage:client-sdk-video:2.30.1"
iOS

CocoaPods dependency changes from:

pod 'OTXCFramework', '2.30.1'

to:

pod 'VonageClientSDKVideo', '2.30.1'

No change in Swift Package Manager.

Windows

NuGet package changes from:

OpenTok.Client

to:

Vonage.Client.Video
Linux No change in package.
React Native

npm dependency changes from:

opentok-react-native

to:

@vonage/client-sdk-video-react-native

2. Across all the Client SDKs, the main change for authentication is that the parameter previously named apiKey is now called applicationId. The parameter order and overall usage remain the same.

3. For the iOS SDK specifically, some initializer method names also included apiKey. These have been renamed to use applicationId instead:

SDK Changes
iOS

For the iOS SDK, initializers that previously used apiKey now use applicationId in the Unified. This applies to both the standard initializer and the one with additional settings:

// OpenTok
OTSession initWithApiKey:sessionId:delegate:
// Unified
OTSession initWithApplicationId:sessionId:delegate:

 

// OpenTok
OTSession initWithApiKey:sessionId:delegate:settings:
// Unified
OTSession initWithApplicationId:sessionId:delegate:settings:

For your convenience, we've also compiled links to the relevant Unified documentation that may be helpful during your migration.

Additional Information