> ## Documentation Index
> Fetch the complete documentation index at: https://docs.overlayed.gg/llms.txt
> Use this file to discover all available pages before exploring further.

> Game events emitted for most or all games.

# Universal

<Info>`overlayed.universal.readyForGameEvents()` must be called before any events will be emitted.</Info>

### logged\_in

The user's account for that particular game. The shape depends on the game — narrow on `game` to
reach the richer fields.

<CodeGroup>
  ```ts type.ts theme={null}
  type LoggedInEvent =
  	| {
  			game: "siege" | "tft";
  			content: { account_id: string };
  	  }
  	| {
  			game: "sand";
  			content: {
  				account_id: string;
  				display_name: string;
  				platform_id: string;
  				playfab_id: string;
  			};
  	  };
  ```

  ```ts narrowing.ts theme={null}
  overlay.universal.on("logged_in", (event) => {
  	if (event.game === "sand") {
  		console.log(event.content.display_name);
  	}

  	console.log(event.content.account_id);
  });
  ```

  ```json example.json theme={null}
  {
  	"account_id": "1234567890"
  }
  ```
</CodeGroup>

For Sand Raiders you can also subscribe on the game module directly, where the type is already
narrowed:

```ts theme={null}
overlay.sand.on("logged_in", (event) => {
	console.log(event.content.display_name);
});
```

### module\_loaded

<CodeGroup>
  ```ts type.ts theme={null}
  interface ModuleLoadedEvent {
  	game_version: string;
  	process_hash: string;
  }
  ```

  ```json example.json theme={null}
  {
  	"game_version": "157.0.1",
  	"process_hash": "2413fb3709b05939f04cf2e92f7d0897fc2596f9ad0b8a9ea855c7bfebaae892"
  }
  ```
</CodeGroup>

### module\_unloaded

<CodeGroup>
  ```ts type.ts theme={null}
  interface ModuleUnloadedEvent {
  }
  ```

  ```json example.json theme={null}
  {}
  ```
</CodeGroup>

### unsupported\_game\_version

<CodeGroup>
  ```ts type.ts theme={null}
  interface UnsupportedGameVersionEvent {
  	game_version: string;
  	process_hash: string;
  }
  ```

  ```json example.json theme={null}
  {
  	"game_version": "157.0.1",
  	"process_hash": "2413fb3709b05939f04cf2e92f7d0897fc2596f9ad0b8a9ea855c7bfebaae892"
  }
  ```
</CodeGroup>
