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:
- Continue using the OpenTok Client SDK with Unified Application ID, Session ID, and Token, or
- Migrate to the Unified Client SDK.
The following sections describe each migration option.
Option 1: Continue using the OpenTok Client SDK
- 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.
- JavaScript: https://tokbox.com/developer/sdks/js/release-notes.html
- Android: https://tokbox.com/developer/sdks/android/release-notes.html
- iOS: https://tokbox.com/developer/sdks/ios/release-notes.html
- Windows: https://tokbox.com/developer/sdks/windows/release-notes.html
- Linux: https://tokbox.com/developer/sdks/linux/release-notes.html
- React Native: https://tokbox.com/developer/sdks/react-native/release-notes.html
- Replace your Project Key with your Application ID when initializing the SDK.
- Ensure your application uses Session IDs and Token generated for your Unified application.
Option 2: Migrate to the Unified Server SDK
- 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.
- JavaScript (Web Client SDK): Developer Guide, Tutorial, Reference, Release Note
- Android: Developer Guide, Tutorial, Reference, Release Note
- iOS: Developer Guide, Tutorial (Swift), Tutorial (Objective-C), Reference, Release Note
- Windows: Developer Guide, Tutorial, Reference, Release Note
- Linux: Developer Guide, Tutorial, Reference, Release Note
- React Native: Developer Guide, Reference, Release Note
Additional Information
Articles in this section
- Migrating Video REST API from OpenTok to Unified
- Video Client SDK Changes from OpenTok to Unified
- How to Migrate from OpenTok Server SDK to Unified Server SDK
- Credential Differences Between OpenTok and Unified Environments
- In which Regional Media Zones can I use Experience Composer?
- How do I monitor Video API call quality in real-time?
- JWT Tokens in the TokBox and Unified Environments
- Android SDK 2.28.2 error when using the application context
- What happens if your session lasts more than 8 hours?
- Updates to using the Vonage Media Library in Native SDKs from version 2.27.x onwards