TFT Spectator — yasuo.tft.spectator¶
Wraps Riot's SPECTATOR-TFT-V5 endpoints: a player's active (live) TFT game
and the featured-games list. It shares the spectator payload shape with LoL, so
it returns the same CurrentGameEntity / FeaturedGamesEntity. Both methods
route by Region (platform).
Every method returns a query — run it with .execute(). The result is the
entity itself, carrying .error and .http; see
Entities & relations and Errors.
Examples assume
const yasuo = new Yasuo({ key })and that apuuidstring already exists.
active(puuid, region)¶
A player's active (live) TFT game, or null if they are not in one.
- Params —
puuid: string— the player's PUUID.region: Region— the platform region. - Returns —
SingleQuery<CurrentGameEntity | null>. A404("not in a game") resolves tonull— an expected empty result, not an error. On success you get aCurrentGameEntitywithgameId,gameMode,gameLength,platformId,participantsandbannedChampions, plus aplatformRegion()helper and lazysummoners()relations. - Routing —
Region.
import { Region } from 'yasuo.js'
const game = await yasuo.tft.spectator.active(puuid, Region.KR).execute()
if (game === null) {
console.log('player is not in a game')
} else if (game.error) {
console.error(game.error.status)
} else {
console.log(game.gameId, game.gameMode, game.participants.length)
}
featured(region)¶
The list of featured TFT games.
- Params —
region: Region— the platform region. - Returns —
SingleQuery<FeaturedGamesEntity>→ aFeaturedGamesEntitywithgameList(an array of live games) and an optionalclientRefreshInterval(suggested seconds between refreshes). - Routing —
Region. - Note — development API keys often receive
403from this endpoint.