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.

Applies To

  • Video API
  • Migrate from OpenTok to Unified
  • Client SDK

Procedure

1. 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://unpkg.com/@vonage/client-sdk-video@2/dist/js/opentok.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
macOS No change in Pod dependency or Swift package manager.
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.

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:

3. After updating your package names, verify that your application builds correctly and can connect to a session using Unified credentials.

Additional Information

For detailed platform guides, refer to the official documentation: