New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zoom/probesdk

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zoom/probesdk

Zoom ProbeSDK tests the end user device and network capabilities, and the Zoom server connection.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
96
increased by317.39%
Maintainers
0
Weekly downloads
 
Created
Source

Probe SDK

Background

Zoom Probe SDK is a tool that you can use to check if audio and video hardware, network, and Zoom infrastructure offers the best experience for your users. This readme will quickly get you started. For full documentation on usage, see the developer documentation. For details about all of the SDK methods, see the SDK reference.

Install

Install the Probe SDK into your project.

$ npm install @zoom/probesdk --save

Import components

Import the Prober class from Probe SDK. For example, in your index.js file.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

Invoke the Prober() constructor directly to create an instance of it. Next, you can access any capability of the prober. See the examples below, and the developer documentation for details.

Request media devices and permission

Invoke requestMediaDevicePermission() to retrieve media device permissions.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

// request media permission
function getMediaPermission() {
    prober.requestMediaDevicePermission({ audio: true, video: true }).then(
      (result) => {
        console.log(stream=${result.stream?.id}, error:${result.error?.message}`);
      }
    );
}

Invoke releaseMediaStream(stream) to release the MediaStream instance returned by calling requestMediaDevicePermission(). Note that ProbeSDK is not responsible for setting the stream to null, the caller should maintain its lifecycle. If stream is not used anymore, it's a good practice to explicitly set it null to make it recycled by GC.

// request media permission
function getMediaPermission() {
    prober.requestMediaDevicePermission({ audio: true, video: true }).then(
      (result) => {
        console.log(`stream=${result.stream?.id}, error:${result.error?.message}`);
        
        // if the stream is not used anymore, it's good practice to release it.
        let succeed = prober.releaseMediaStream(result.stream);
        console.log(succeed);
        
        // ProbeSDK is not responsible for setting it null, the caller should maintain its lifecycle
        result.stream = null;
      }
    );
}

Invoke requestMediaDevices() to retrieve media devices.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

// request media devices
function getMediaDevices() {
  prober.requestMediaDevices().then((result) => {
    console.log(`error:${result.error}, devices=${result.devices}`);
  });
}

Diagnose audio and video

Invoke diagnoseAudio to check whether the audio devices work.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

// start an audio diagnostic
function startToDiagnoseAudio() {
  const audioInputConstraint = {
    audio: { deviceId: "default" },
    video: false,
  };
  const audioOutputConstraint = {
    audio: { deviceId: "xxxxxxxxxxxxxxxx" },
    video: false,
  };

  const duration = 5000; // how long you want to record the sound, milliseconds
  const diagnoseResult = prober.diagnoseAudio(
    audioInputConstraint,
    audioOutputConstraint,
    duration
  );
  console.log(diagnoseResult);
}

Invoke diagnoseVideo to check whether or not the video devices work.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();
let videoDiagnosticResult;

// start a video diagnostic
function startToDiagnoseVideo(canvas) {
  const constraint = {
    video: {
      deviceId: "default",
    },
  };
  const options = {
    rendererType: 2, // WebGL
    target: canvas,
  };
  prober.diagnoseVideo(constraint, options).then((result) => {
    console.log(result);
    videoDiagnosticResult = result;
  });
}

Call stopToDiagnoseVideo(stream) to stop diagnosing video. The parameter stream saved in the result of calling diagnoseVideo is optional. Note that: If you don't pass this parameter when you call this function, it simply stops the preview part of the video diagnostic, and you need to call releaseMediaStream(stream) at the right time to close the video stream.

import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();
let videoDiagnosticResult;

function stopToDiagnoseVideo() {
  let result = prober.stopToDiagnoseVideo(videoDiagnosticResult.stream);
  videoDiagnosticResult.stream = null;
  console.log(`stopToDiagnoseVideo() result: ${result}`);
}

// or call releaseMediaStream(stream) to release the MediaStream anytime
prober.releaseMediaStream(videoDiagnosticResult.stream);

Start a comprehensive diagnostic test

Perform a network diagnostic to return a network diagnostic report that also includes basic information and supported features.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

function startToDiagnose() {
  // 1. you can ignore the URLs, so the default URLs that deployed in the ProbeSDK will be used
  const jsUrl = "";
  const wasmUrl = "";
  const config = { 
    probeDuration: 120 * 1000,
    connectTimeout: 120 * 1000,
    domain: '[a Zoom or custom domain]',
  };
  prober
    .startToDiagnose(jsUrl, wasmUrl, config, (stats) => {
      console.log(stats);
    })
    .then((report) => {
      // a DiagnosticReport has main 3 structures we need to handle
      console.log(report.networkDiagnosticResult);
      console.log(report.basicInfoEntries);
      console.log(report.featureEntries);
    });
}

When the diagnostic program is finished, we suggest that it is a good idea to call the cleanup() function to clean up some of the resources created in ProbeSDK (e.g., some memory resources, closing the network connection used for diagnostics, etc.). For example, it is a good time to call it when the user closes the diagnostics page or jumps to another page.

prober.cleanup();

Generate a report of supported features

This Reporter provides detection services to report if video conferencing features are supported on the target device.

const reporter = new Reporter();
function showBasicInfo() {
    reporter.reportBasicInfo(navigator).then((info) => {
        console.log(JSON.stringify(info));
    });
}

function showSupportedFeatures() {
    reporter.reportFeatures().then((features) => {
        console.log(JSON.stringify(features));
    });
}

Changelog

For the changelog, see Probe SDK - web.

Support

For any issues regarding our SDK, reach out to Developer Support.

License

Use of this SDK is subject to our License and Terms of Use;

Open Source Software Source Code

Some licenses for OSS contained in our products give you the right to access the source code under said license. You may obtain a copy of source code for the relevant OSS via the following link: https://zoom.us/opensource/source. Please obtain independent legal advice or counsel to determine your responsibility to make source code available under any specific OSS project.

Appendix: Platform/Browser Compatibility

API
DesktopMobile
WindowsMacOSLinuxChromeOSAndroidiOS
ChromeFirefoxEdgeOperaChromeFirefoxEdgeOperaSafariChromeFirefoxChromeChromeFirefoxEdgeChromeSafariFirefox
requestMediaDevicePermissionY(125 64-bit)Y(125.0.1 64-bit)Y(124 64-bit)Y(110 64-bit)Y(125 64-bit)Y(126.0.1 64-bit)Y(125 64-bit)Y(110 64-bit)Y(17.5)Y(113 64-bit)Y(114.0 64-bit)Y(124 64-bit)Y(125 64-bit)Y(125 64-bit)YY(125 64-bit)Y(125)Y(17.5)Y(126.2)
releaseMediaStreamY(125 64-bit)Y(125.0.1 64-bit)Y(124 64-bit)Y(110 64-bit)Y(125 64-bit)Y(126.0.1 64-bit)Y(125 64-bit)Y(110 64-bit)Y(17.5)Y(113 64-bit)Y(114.0 64-bit)Y(124 64-bit)Y(125 64-bit)Y(125 64-bit)YY(125 64-bit)Y(125)Y(17.5)Y(126.2)
requestMediaDevicesY(125 64-bit)Y(125.0.1 64-bit)Y(124 64-bit)Y(110 64-bit)Y(125 64-bit)Y(126.0.1 64-bit)Y(125 64-bit)Y(110 64-bit)Y(17.5)Y(113 64-bit)Y(114.0 64-bit)Y(124 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125)Y(17.5)Y(126.2)
diagnoseAudioY(125 64-bit)Y(125.0.1 64-bit)Y(124 64-bit)Y(110 64-bit)Y(125 64-bit)Y(126.0.1 64-bit)Y(125 64-bit)Y(110 64-bit)Y(17.5)Y(113 64-bit)Y(114.0 64-bit)Y(124 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125)Y(17.5)Y(126.2)
diagnoseVideoY(125 64-bit)Y(125.0.1 64-bit)
WebGPU
Y(124 64-bit)Y(110 64-bit)Y(125 64-bit)Y(126.0.1 64-bit)Y(125 64-bit)Y(110 64-bit)Y(17.5)
WebGPU
Y(113 64-bit)
WebGPU
Y(114.0 64-bit)
WebGPU
Y(124 64-bit)Y(125 64-bit)Y(125 64-bit)
WebGPU
Y(125 64-bit)
WebGPU
Y(125)
WebGPU
Y(17.5)
WebGPU
Y(126.2)
WebGPU
stopToDiagnoseVideoY(125 64-bit)Y(125.0.1 64-bit)Y(124 64-bit)Y(110 64-bit)Y(125 64-bit)Y(126.0.1 64-bit)Y(125 64-bit)Y(110 64-bit)Y(17.5)Y(113 64-bit)Y(114.0 64-bit)Y(124 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125)Y(17.5)Y(126.2)
startToDiagnoseY(125 64-bit)Y(125.0.1 64-bit)Y(124 64-bit)Y(110 64-bit)Y(125 64-bit)Y(126.0.1 64-bit)Y(125 64-bit)Y(110 64-bit)Y(17.5)Y(113 64-bit)Y(114.0 64-bit)Y(124 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125 64-bit)Y(125)Y(17.5)Y(126.2)

Copyright ©2024 Zoom Video Communications, Inc. All rights reserved.

Keywords

FAQs

Package last updated on 05 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc