npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vbet/vt-node-sdk

v1.0.1

Published

NodeJS SDK for VT Devices

Downloads

184

Readme

VT Node.js SDK

Table of Contents

Pre-requisite

  1. Node.js v8.x or later.

  2. On MacOS: xcode & python 3.7. By default, Python is installed on macOS but make sure correct version(3.7+) is installed. Install Xcode from App store or download it from here.

  3. On Windows: Visual C++ Build Tools & Python 3.7. You can install all of these by following any of the below mentioned steps.

    3.1. During Node.js installation By ticking the checkbox when prompted during Node.js installation for Tools for Native modules, this installs both Visual C++ Build Tools & Python 3.7. Note This is prompted only for Windows platform. For other platforms like Linux or MAC, C++ compilation tools has to be installed separately as mentioned in other steps.

    3.2. Both Visual C++ Build Tools & Python 3.7 can also be installed using command npm install --global --production --add-python-to-path windows-build-tools. To know more about this tool, see this link.. Note For executing this command through Windows Command Prompt or Windows PowerShell, they should be ran in Administrator mode.

  4. On Linux: build-essential package for C++ compilation & Python 3.7.

    4.1. Udev rules: To be able to communicate with VT devices with non-root privileges it is required to create a udev rule for VT devices. Place the udev rule in /etc/udev/rules.d, and follow naming guidelines for udev files.

    Example: The file name should be something like 80-vt.rules where the number before the dash indicates in what order the system reads the rules (e.g. if you had another rules file called 70-someotherrule.rules, it would read that one first), the word after the dash is just an identifier of sorts (it could be something other than vt) and the extension must be .rules.

    The contents of the file are:

    ATTRS{idVendor}=="340b", MODE="0666", GROUP="users"

    After creating the udev file (as root), reload the udev rules using:

    sudo udevadm control --reload

    Reattach your VT device in order to get new permissions assigned.

  5. All Platforms: node-gyp. You can install this using command npm install -g node-gyp. To know more about this, see this link

  6. For Electron.JS: If you are using asar packaging then you may need to unpack some of the resources used in this module. These resources are native library files i.e sdk.dll, libsdk.dylib & libsdk.so, which is stored in a build\Release folder. By default latest electron builder will automatically unpack, but if it does not work then you can provide below option to your build process. To know more, see this link

"build": {
    "asarUnpack": ["node_modules/@vbet/vt-node-sdk"]
}
  1. If you are using webpack or similar module bundler, you may need to exclude the sdk from the bundle. In webpack, you say which externals you have in your webpack-config.js:
  externals: {
    "@vbet/vt-node-sdk": "commonjs @vbet/vt-node-sdk",
  },

Installation

npm install @vbet/vt-node-sdk

Examples

Simple button events example using javascript and plain promises

const { initSdk, CallAction } = require("@vbet/vt-node-sdk");
initSdk().then((vtSdk) => {
  vtSdk.RegEvent("attach", (deviceImpl) => {
    console.log("device attached:" + deviceImpl.deviceName);

    deviceImpl.RegEvent("callAction", (action) => {
      console.log("new input from device is received: ", action);
      //........
      //softphone do something to update the call state, once done inform device to sync state
      switch (action) {
        case CallAction.ACCEPT_CALL:
          deviceImpl.setOffHookAsync(true);
          break;
        case CallAction.END_CALL:
          deviceImpl.setOffHookAsync(false);
          break;
        case CallAction.MUTE_CALL:
          deviceImpl.setMuteAsync(true);
          break;
        case CallAction.UNMUTE_CALL:
          deviceImpl.setMuteAsync(false);
          break;
        case CallAction.HOLD_CALL:
          deviceImpl.setHoldAsync(true);
          break;
        case CallAction.RESUME_CALL:
          deviceImpl.setHoldAsync(false);
          break;
        case CallAction.REJECT:
          deviceImpl.setRingAsync(false);
          break;
      }
    });

    deviceImpl.setRingAsync(true);
  });
});

Multiple device management with typescript and async/await

import { initSdk } from "@vbet/vt-node-sdk";

(async () => {
  let vtSdk = await initSdk();

  await vtSdk.firseScanForDeviceDoneAsync(); // Wait for all pre-attached devices to be scanned.

  const deviceInstanceList = vtSdk.getAttachedDevices();
  if (deviceInstanceList.length < 2) {
    throw new Error("please make sure 2 vt devices are attached");
  }

  const firstDevice = deviceInstanceList[0];
  await firstDevice.setRingAsync(true);

  const secondDevice = deviceInstanceList[1];
  await secondDevice.setRingAsync(true);

  // Dispose vt sdk to enable node process to shutdown.
  await vtSdk.disposeAsync();
})();