Skip to content
Teddy Brine edited this page Jul 15, 2023 · 13 revisions

GOXLR JS

Welcome to the documentation for GOXLR JS. This is a simple JavaScript wrapper which uses the GoXLR Utility API running on your local machine.

Privacy

It would be against the law for us to collect any data from you, and we don't want to. Therefore, we don't. All data is stored locally, and is not sent anywhere. We don't even have a server to send it to. This means your serial number is safe.

Standards

Custom Connection Information

As of v1.2.0 you can customize the IP address and port of the GoXLR Utility Instance. To do this, when initialising your instance, use this code:

As of v1.3.0 you can use custom serial numbers, so if you have more then one device connected you can directly connect.

const goxlrInstance = new goxlr('127.0.0.1', 14564, "XXXXXXXXX");

*Providing an IP and port is not required and therefore optional. Just note, without providing parameters it will use the default 127.0.0.1 and 14564. To not opt into a certain argument, used undefined and it will use the default value.`

Managing Connections

A popular request prior to v1.2.0 was to be able to not have to open a connection then close it on each function. Now, developers can control the connections. A connection will stay open from the time a function is ran till a developer uses the following code:

As of v1.3.0 you can also mange opening connections.

connect();
close();

Support

If you need any help, join the Discord Server and give me a ping @t3d.uk. I'll be happy to help. If you find a bug, please open an issue on the GitHub Issues page.

Installation

To install GoXLR JS, simply run npm i goxlr@latest in your project directory.

Initialization

To use all features of GoXLR JS, you will need to imitate a GoXLR Instance. This is done by using the following code:

const { goxlr } = require("goxlr");
const goxlrInstance = new goxlr();

Event Queue

Since v1.2.1 an event queue system has been in place. When running a command, a singular response will be returned. We are working on how we could send through any patches as well.

Note The API uses an ID system so the correct function gets the correct info back. In the circumstances a function does not get a response there is a 10 second timeout.

const { goxlr } = require("goxlr");

const goxlrInstance = new goxlr("127.0.0.1", 14564);

(async () => {
  const data = await goxlrInstance.loadProfile("default", true);
  console.log(data);
  await goxlrInstance.close();
})();

Asynchronous Code

All functions should be ran asynchronously. Top Level Async Functions isn't supported in NodeJS unless a module.

(async () => {
    // Function Code here
})();

Example

const { goxlr } = require("goxlr");
const goxlrInstance = new goxlr();

(async () => {
    await goxlrInstance.setVolume("Mic", 100)
    await goxlrInstance.close();
})();

GoXLR JS

GoXLR JS is a JavaScript Wrapper for GoXLR Utility API made by the GoXLR on Linux Organisation.

Update to Latest Version

npm i goxlr@latest

Boilerplate Code

const { goxlr } = require("goxlr");

const goxlrInstance = new goxlr("127.0.0.1", 14564);

(async () => {
  await goxlrInstance.loadProfile("default", true);
  await goxlrInstance.close();
})();
Clone this wiki locally