> ## 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.

# Overlay Events

> The main overlay object has a variety of events you can listen to on it

## Game Launch

Runs right when the game's process is created.

To listen for a game launch event, you must do one of the following:

* Enable universal mode in your [configuration](/packages/overlayed-options#universal).
* Pass a [module](/packages/overlayed-options#modules) to the configuration.

#### Usage

```typescript theme={null}
overlay.on("gameLaunch", ({ game, reject }) => {
	// ...
});
```

#### Rejecting a Game Launch

You can reject the game launch from being handled by the overlay by calling `reject()`:

```typescript theme={null}
overlay.on("gameLaunch", ({ game, reject }) => {
	if (game === "valorant") {
		reject();
		return;
	}

	// ...
});
```

This is useful if you have a setting that disables your overlay for a given game.

<Accordion title="More about reject()">
  Calling `reject()` will do the following for the particular `game`:

  * Prevent the overlay from rendering in the game
  * Block game events from being emitted
  * Prevent gameReady from being emitted
</Accordion>

## Game Ready

Runs once the overlay is ready to render in game and start listening for game events.

```typescript theme={null}
overlay.on("gameReady", ({ game, inGameRenderingSupported }: { game: string; inGameRenderingSupported: boolean }) => {
	if (game === "siege") {
		// ...
	}
});
```

## Game Closed

```typescript theme={null}
overlay.on("gameClose", ({ game }) => {
	if (game === "siege") {
		// ...
	}
});
```
