@z0mt3c/f1-telemetry-client
v2.0.0
Published
[](https://github.com/z0mt3c/f1-telemetry-client/actions/workflows/node.js.yml) [;
/*
* 'port' is optional, defaults to 20777
* 'bigintEnabled' is optional, setting it to false makes the parser skip bigint values,
* defaults to true
* 'forwardAddresses' is optional, it's an array of Address objects to forward unparsed telemetry to. each address object is comprised of a port and an optional ip address
* defaults to undefined
* 'skipParsing' is optional, setting it to true will make the client not parse and emit content. You can consume telemetry data using forwardAddresses instead.
* defaults to false
*/
const client = new F1TelemetryClient({ port: 20777 });
client.on(PACKETS.event, console.log);
client.on(PACKETS.motion, console.log);
client.on(PACKETS.carSetups, console.log);
client.on(PACKETS.lapData, console.log);
client.on(PACKETS.session, console.log);
client.on(PACKETS.participants, console.log);
client.on(PACKETS.carTelemetry, console.log);
client.on(PACKETS.carStatus, console.log);
client.on(PACKETS.finalClassification, console.log);
client.on(PACKETS.lobbyInfo, console.log);
client.on(PACKETS.carDamage, console.log);
client.on(PACKETS.sessionHistory, console.log);
client.on(PACKETS.tyreSets, console.log);
client.on(PACKETS.motionEx, console.log);
client.on(PACKETS.timeTrial, console.log);
// to get further communication details like remoteInfo
client.on(PACKETS.timeTrial + ':raw', console.log);
// to catch all events
client.on('*', console.log);
// to start listening:
client.start();
// and when you want to stop:
client.stop();Documentation
The following links contain information that summarises the UDP data structures so that developers of supporting hardware or software are able to configure these to work correctly with the F1 game.
- F1 2025 UDP Spec (WIP)
- F1 2024 UDP Spec
- F1 2023 UDP Spec
- F1 2022 UDP Spec
- F1 2020 UDP Spec
- F1 2021 UDP Spec
- F1 2019 UDP Spec
- F1 2018 UDP Spec
License
This project has originally been developed by and was forked from @racehub-io. The original source is located at @racehub-io/f1-telemetry-client.
Licensed under the MIT License.
