One overlay for every game
Most of the API is the same in every game, but not all of it. Here is how to find out what the running game gives and draw well with what is there.
Which games the overlay is for
The manifest says it: "*" for every game with telemetry, or a list. Racelink offers the overlay only for those games.
"games": "*"
"games": ["iracing", "le-mans-ultimate"]Pick "*" when the overlay shows common data (pedals, speed, laps). A list fits an overlay built around one game’s own system, such as iRacing’s iRating.
What the running game gives
overlay.game is the running game’s id, or null without one. overlay.supports(path) tells whether that game fills a field:
overlay.on('telemetry', ({ car }) => {
// Not every game says whether the pit limiter is on; hide the light there.
limiter.hidden = !overlay.supports('car.pitLimiterActive');
limiter.classList.toggle('on', car.pitLimiterActive === true);
});{overlay.supports('car.pitLimiterActive') && (
<span className={car.pitLimiterActive ? 'limiter on' : 'limiter'}>PIT</span>
)}Ask by field, not by game: a check on overlay.game === 'iracing' breaks the day another game starts giving the value, and supports keeps up by itself. The field reference lists the games of each field and filters by game.
Fields of one game
What exists in one game only lives under ext.<game> of its record and is null in every other game. Read it with ?.:
const rating = driver.ext.iracing?.iRating ?? null;
const incidents = session.ext.iracing?.incidents.count ?? null;If another game later gains the same idea, the field becomes common under a name for all, and the ext path keeps working for a while, marked as deprecated.
Fields the overlay cannot do without
List them in requires. A misspelt path is an error at build time, so a typo never reaches players:
"requires": ["car.throttle", "car.brake"]Draw well with less
Try every game
?demo=<game> runs the demo of one game, with its own ext fields and the values it leaves empty:
http://localhost:5173/?demo=iracing
http://localhost:5173/?demo=le-mans-ultimate
http://localhost:5173/?demo=assetto-corsa
http://localhost:5173/?demo=assetto-corsa-evo
http://localhost:5173/?demo=assetto-corsa-rally