New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@vbet/webhid-sdk

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vbet/webhid-sdk

Controls VBet devices from WebHID

latest
npmnpm
Version
1.4.5
Version published
Maintainers
1
Created
Source

Installation

Include the package locally in your repository.

npm install @vbet/webhid-sdk

API Usage

import { webhidConsent, IDevice, DeviceSignalType, findDevice } from '@vbet/webhid-sdk';

device = webhidConsent({config: {productId?: number}})

  • Triggers WebHID consent dialogue in compatible browsers to grant device access

device = findDevice(name:string)

  • Gets a granted device by name

device.ring()

  • Starts "ringing" effect on the device

device.offHook()

  • Makes device to offhook, used to answer incomming call or start outgoing call

device.onHook()

  • Makes device to onhook, used to terminate current call or reject incomming call

device.muteOn()

  • Mutes device's microphone

device.muteOff()

  • Unmutes device's microphone

device.subscribe(callback: (signal: DeviceSignalType) => void)

  • Subscribes to device event

device.unsubscribe()

  • Unsubscribes to device event

Example of Usage

const device = await webhidConsent({productId:0x0014});

//listen to device's event
device.subscribe((signal) => {
    switch (signal) {
        case DeviceSignalType.ACCEPT_CALL:
          //call was accepted by the device, softphone should answer the call
          //Remark: must call this function to sync device state either at here or somewhere at softphone state change confirmation callback 
          device.offHook()
          break;
        case DeviceSignalType.END_CALL:
          //call was ended by the device, softphone should end the call
          //Remark: must call this function to sync device state either at here or somewhere at softphone state change confirmation callback 
          device.onHook()
          break;
        case DeviceSignalType.REJECT_CALL:
          //call was ended by the device, softphone should end the call
          //Remark: must call this function to sync device state either at here or somewhere at softphone state change confirmation callback 
          device.onHook()
          break;
        case DeviceSignalType.MUTE_CALL:
          //call was muted by the device, softphone should mute the call
          //Remark: must call this function to sync device state either at here or somewhere at softphone state change confirmation callback 
          device.muteOn()
          break;
        case DeviceSignalType.UNMUTE_CALL:
          //call was unmuted by the device, softphone should unmute the call
          //Remark: must call this function to sync device state either at here or somewhere at softphone state change confirmation callback 
          device.muteOff()
          break;
    }
});

device.ring()

FAQs

Package last updated on 26 Jul 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