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:
- 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
- macOS: Developer Guide, Reference, Release Note
- Linux: Developer Guide, Tutorial, Reference, Release Note
- React Native: Developer Guide, Reference, Release Note
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