The `opentok-network-test-js` library provides a client-side JavaScript utility for pre-call network diagnostics within applications using the Vonage OpenTok platform. It enables developers to proactively test an end-user's network conditions, including UDP/TCP connectivity to OpenTok servers, available bandwidth, and estimated media quality (packet loss, jitter, latency). The library is currently at version 5.0.0, indicating active development. While there isn't a fixed, rapid release cadence, minor and patch updates are regularly issued to address bugs and dependencies, with major versions released as significant behavioral changes or API refactorings occur. Its primary differentiation lies in its direct integration with the OpenTok ecosystem, offering specific and relevant diagnostic feedback for OpenTok-based WebRTC sessions, which generic WebRTC tests might miss. It ships with TypeScript definitions, making it well-suited for modern JavaScript and TypeScript projects.
npm install opentok-network-test-jsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to instantiate the OTNetworkTest, subscribe to events, and run both connectivity and quality tests. It highlights error handling and cleanup.
Refactor promise handling for `testConnectivity` and `testQuality` to use `try...catch` blocks or `.catch()` for explicit error management, as failures are now propagated as rejections.
Review your TypeScript code for type mismatches related to `opentok-network-test-js` and update type imports or custom interfaces according to the new type definitions.
Ensure that camera and microphone permissions are requested and granted before initiating `testQuality`. Implement UI feedback and re-request mechanisms for `Permission Denied` errors.
Always use the latest stable version of `opentok-network-test-js` to ensure you benefit from the most recent security patches and dependency updates.
Ensure your application requests camera/microphone permissions before starting `testQuality`. Provide clear UI prompts to the user.
Use `import { OTNetworkTest } from '@opentok/opentok-network-test-js';` for ESM. If using CJS in an older environment (uncommon), you might need `const { OTNetworkTest } = require('@opentok/opentok-network-test-js');` but the library is primarily designed for ESM.Update to version `4.0.2` or later. If using an older version, ensure permissions are not revoked during an active test, or manually stop the test instance (`networkTest.stop()`) if permissions change.
No dependency data recorded yet.