Talk with the MulitiViewer API easily
This package is a Node.js wrapper around MulitiViewer.
You can use it to start building projects using the MultiViewer Live Timing API...
npm install npm_f1mv_api
import {
discoverF1MVInstances,
getAPIVersion,
getF1MVVersion,
LiveTimingAPIV1,
LiveTimingAPIV2,
LiveTimingAPIGraphQL,
Config
} from "npm_f1mv_api";
(async () => {
let port;
try {
port = (await discoverF1MVInstances("localhost")).port;
} catch (error) {
console.error(
"No MultiViewer instances founded on the requested host. Check if MultiViewer is running or if MultiViewer is allowed in your FireWall rules."
);
return;
}
const config: Config = {
host: "localhost",
port: port,
};
console.log(await discoverF1MVInstances(config.host));
console.log(await getF1MVVersion(config));
console.log(await getAPIVersion(config));
console.log(await LiveTimingAPIV1(config, "TrackStatus"));
console.log(await LiveTimingAPIV2(config, ["TrackStatus", "WeatherData"]));
console.log(
await LiveTimingAPIGraphQL(config, ["TrackStatus", "WeatherData"])
);
})();
See the auto-generated docs for more info on methods and parameters.
To run the included demo:
- clone repo
- install node deps
- then in your terminal run
ts-node test/demo.ts
All of these awesome projects are built using the npm_f1mv_api
package. 🤯
Be the first to create a project !
If you create a cool integration, feel free to open a PR and add it to the list.
This package is ESM-only.