Skip to main content

The following sample lists Jabra devices (more specifically, their names) whenever they are connected.

  1. Create an empty package.json and install jabra-js:
npm init -y
npm i @gnaudio/jabra-js --save
  1. Create an empty index.js file and initialize the library by using the following code snippet:
const jabra = require('@gnaudio/jabra-js/node-cjs');
async function app() {
// Initialize Jabra library
const api = await jabra.init();
// Subscribe to notifications about Jabra devices
api.deviceList.subscribe((devices) => {
// Iterate through the devices
devices.forEach((device) => {
// Log the name of the device
console.log(device.name);
});
});
}
app();
  1. Start your app by running the following command in a terminal:
node index.js
  1. Attach a Jabra device (no problem if you already did this) to see the device name logged to console.

Next steps#

Follow the Call Control tutorial to learn how to control a Jabra headset in regards to a call (e.g. ringing, accepting the call, muting, holding).