Skip to main content

Overview

The event data system defines all data structures used to communicate match state between clients (observer, auxiliary) and the server. Events are strongly typed using TypeScript interfaces and discriminated by the DataTypes enum.

DataTypes Enum

export enum DataTypes {
  // Observer Data
  SCOREBOARD = "scoreboard",
  KILLFEED = "killfeed",
  ROSTER = "roster",
  MATCH_START = "match_start",
  ROUND_INFO = "round_info",
  TEAM_IS_ATTACKER = "team_is_attacker",
  SCORE = "score",
  GAME_MODE = "game_mode",
  MAP = "map",
  OBSERVING = "observing",
  SPIKE_DETONATED = "spike_detonated",
  SPIKE_DEFUSED = "spike_defused",
  
  // Authentication
  AUTH = "authenticate",
  AUX_AUTH = "aux_authenticate",
  
  // Auxiliary Data
  AUX_ABILITIES = "aux_abilities",
  AUX_HEALTH = "aux_health",
  AUX_SCOREBOARD = "aux_scoreboard",
  AUX_SCOREBOARD_TEAM = "aux_scoreboard_team",
  AUX_ASTRA_TARGETING = "aux_astra_targeting",
  AUX_CYPHER_CAM = "aux_cypher_cam",
  
  // Hotkey Events
  SPIKE_PLANTED = "spike_planted",
  TECH_PAUSE = "tech_pause",
  LEFT_TIMEOUT = "left_timeout",
  RIGHT_TIMEOUT = "right_timeout",
  SWITCH_KDA_CREDITS = "switch_kda_credits",
  
  // Preview
  PREVIEW = "preview",
}

Observer Event Interfaces

IFormattedScoreboard

export interface IFormattedScoreboard {
  name: string;
  tagline: string;
  playerId: string;
  startTeam: number;  // 0 or 1
  agentInternal: keyof typeof Agents;
  isAlive: boolean;
  initialArmor: number;  // 0, 1, or 2
  scoreboardWeaponInternal: keyof typeof WeaponsAndAbilities;
  currUltPoints: number;
  maxUltPoints: number;
  hasSpike: boolean;
  money: number;
  kills: number;
  deaths: number;
  assists: number;
}
Sent when the observer client detects scoreboard updates.
name
string
Player’s display name.
tagline
string
Riot ID tagline.
playerId
string
Player’s unique identifier (PUUID).
startTeam
number
Team ID (0 = attackers at start, 1 = defenders at start).
agentInternal
string
Internal agent identifier (e.g., “Clay_PC_C” for Raze).
isAlive
boolean
Whether the player is currently alive.
initialArmor
number
Armor type: 0 = none, 1 = light (25 HP), 2 = heavy (50 HP).
scoreboardWeaponInternal
string
Internal weapon identifier for the best weapon held.
currUltPoints
number
Current ultimate points.
maxUltPoints
number
Ultimate points required for this agent.
hasSpike
boolean
Whether this player is carrying the spike.
money
number
Current credits.
kills
number
Total kills.
deaths
number
Total deaths.
assists
number
Total assists.

IFormattedKillfeed

export interface IFormattedKillfeed {
  attacker: string;
  victim: string;
  weaponKillfeedInternal: keyof typeof WeaponsAndAbilities;
  headshotKill: boolean;
  assists: string[];  // Array of assisting agent internal names
  isTeamkill: boolean;
}
Sent when a kill appears in the killfeed.
attacker
string
Name of the player who got the kill.
victim
string
Name of the player who died.
weaponKillfeedInternal
string
Internal weapon/ability identifier used for the kill.
headshotKill
boolean
Whether the kill was a headshot.
assists
string[]
Array of internal agent names that assisted (e.g., [“Jett_PC_C”]).
isTeamkill
boolean
Whether this was a friendly fire kill.

IFormattedRoster

export interface IFormattedRoster {
  name: string;
  tagline: string;
  startTeam: number;
  agentInternal: keyof typeof Agents;
  playerId: string;
  position: number;  // 0-4
  locked: boolean;
  rank: number;
}
Sent during agent select and when player data updates.
position
number
Player’s position in team roster (0-4).
locked
boolean
Whether the agent selection is locked.
rank
number
Player’s competitive rank tier.

IFormattedRoundInfo

export interface IFormattedRoundInfo {
  roundPhase: string;
  roundNumber: number;
}
roundPhase
string
Current phase: “LOBBY”, “shopping”, “combat”, “end”, “game_end”.
roundNumber
number
Current round (1-indexed).

IFormattedScore

export interface IFormattedScore {
  team_0: number;
  team_1: number;
}
team_0
number
Rounds won by team 0 (attackers at start).
team_1
number
Rounds won by team 1 (defenders at start).

Authentication Interfaces

IAuthenticationData

export interface IAuthenticationData {
  type: DataTypes.AUTH;
  clientVersion: string;
  obsName: string;
  key: string;
  groupCode: string;
  groupSecret?: string;
  leftTeam: AuthTeam;
  rightTeam: AuthTeam;
  toolsData: ToolsData;
  organizationId?: string;  // Added by server
  isSupporter?: boolean;    // Added by server
}
Sent by the observer client to initialize a match.
clientVersion
string
Version of the observer client.
obsName
string
Observer’s display name.
key
string
Authentication key for the organization.
groupCode
string
Unique code for this match session.
groupSecret
string
Secret for reconnecting to existing match.
leftTeam
AuthTeam
Configuration for the left team.
{
  name: string;
  tricode: string;
  url: string;  // Logo URL
  attackStart: boolean;
}
rightTeam
AuthTeam
Configuration for the right team (same structure as leftTeam).
toolsData
ToolsData
Tournament info, sponsors, timeouts, and display settings.

IAuxAuthenticationData

export interface IAuxAuthenticationData {
  type: DataTypes.AUX_AUTH;
  clientVersion: string;
  name: string;
  matchId: string;
  playerId: string;
}
Sent by auxiliary (player) clients to connect to a match.
name
string
Player’s display name.
matchId
string
The match ID to join.
playerId
string
Player’s PUUID.

Auxiliary Event Interfaces

IFormattedAuxiliary

export interface IFormattedAuxiliary {
  type: DataTypes.AUX_SCOREBOARD
    | DataTypes.AUX_SCOREBOARD_TEAM
    | DataTypes.AUX_ABILITIES
    | DataTypes.AUX_HEALTH
    | DataTypes.AUX_ASTRA_TARGETING
    | DataTypes.AUX_CYPHER_CAM;
  playerId: string;
  matchId: string;
  data: IFormattedScoreboard
    | IFormattedAuxScoreboardTeam[]
    | IFormattedAbilities
    | number
    | string
    | boolean;
}
Base structure for auxiliary client events.

IFormattedAuxScoreboardTeam

export interface IFormattedAuxScoreboardTeam {
  playerId: string;
  agentInternal: keyof typeof Agents;
  isAlive: boolean;
  initialArmor: number;
  scoreboardWeaponInternal: keyof typeof WeaponsAndAbilities;
  currUltPoints: number;
  maxUltPoints: number;
  hasSpike: boolean;
  money: number;
  kills: number;
  deaths: number;
  assists: number;
}
Scoreboard data for team members (sent as array from auxiliary client).

IFormattedAbilities

export interface IFormattedAbilities {
  grenade: number;    // Q ability charges
  ability_1: number;  // E ability charges
  ability_2: number;  // C ability charges
}
Ability charge counts from auxiliary client.

Authenticated Event Wrappers

IAuthedData

export interface IAuthedData {
  obsName: string;
  groupCode: string;
  type: string;
  timestamp: number;
  data: IFormattedScoreboard
    | IFormattedKillfeed
    | IFormattedRoster
    | IFormattedRoundInfo
    | IFormattedScore
    | IFormattedAuxiliary
    | boolean
    | string
    | number;
}
Wrapper for all observer events after authentication.
obsName
string
Observer client identifier.
groupCode
string
Match session code.
type
string
Event type from DataTypes enum.
timestamp
number
Unix timestamp in milliseconds.
data
union
Event payload (type depends on type field).

IAuthedAuxData

export interface IAuthedAuxData {
  playerId: string;
  matchId: string;
  type: string;
  timestamp: number;
  data: IFormattedAuxiliary | number | boolean;
}
Wrapper for all auxiliary client events.
playerId
string
Player’s PUUID.
matchId
string
Match identifier.

Type Guard

export function isAuthedData(data: object): data is IAuthedData | IAuthedAuxData
Type guard to check if an object is authenticated event data.

Example Event Flow

// 1. Observer authenticates
const authEvent: IAuthenticationData = {
  type: DataTypes.AUTH,
  clientVersion: "1.0.0",
  obsName: "Observer1",
  key: "org-api-key",
  groupCode: "MATCH123",
  leftTeam: { name: "Team A", tricode: "TMA", url: "", attackStart: true },
  rightTeam: { name: "Team B", tricode: "TMB", url: "", attackStart: false },
  toolsData: new ToolsData()
};

// 2. Match starts
const matchStartEvent: IAuthedData = {
  obsName: "Observer1",
  groupCode: "MATCH123",
  type: DataTypes.MATCH_START,
  timestamp: Date.now(),
  data: "match-uuid-456"
};

// 3. Scoreboard update
const scoreboardEvent: IAuthedData = {
  obsName: "Observer1",
  groupCode: "MATCH123",
  type: DataTypes.SCOREBOARD,
  timestamp: Date.now(),
  data: {
    name: "Player1",
    tagline: "NA1",
    playerId: "player-uuid-1",
    startTeam: 0,
    agentInternal: "Jett_PC_C",
    isAlive: true,
    initialArmor: 2,
    scoreboardWeaponInternal: "vandal",
    currUltPoints: 5,
    maxUltPoints: 7,
    hasSpike: false,
    money: 3200,
    kills: 10,
    deaths: 7,
    assists: 4
  }
};

// 4. Auxiliary client sends abilities
const abilitiesEvent: IAuthedAuxData = {
  playerId: "player-uuid-1",
  matchId: "match-uuid-456",
  type: DataTypes.AUX_ABILITIES,
  timestamp: Date.now(),
  data: {
    type: DataTypes.AUX_ABILITIES,
    playerId: "player-uuid-1",
    matchId: "match-uuid-456",
    data: {
      grenade: 1,
      ability_1: 2,
      ability_2: 1
    }
  }
};

Build docs developers (and LLMs) love