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

# OverlayedOptions

> The options object passed into the `overlayed` function

All overlay configuration happens within your codebase, which gives full flexibility.

The following properties can be passed into the `overlayed` function:

## electron

The electron instance to use for the overlay. Note this should be globally imported from the electron package.

* **Type**

  ```typescript theme={null}
  electron: Electron;
  ```

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";
  import electron from "electron";

  const overlay = overlayed({
  	electron,
  	// ...
  });
  ```

## applicationId

The id of the application, this can be found in the [Overlayed Dashboard](https://overlay.dev/settings/applications)

* **Type**

  ```typescript theme={null}
  applicationId: string;
  ```

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	applicationId: "APPLICATION_ID_GOES_HERE",
  	// ...
  });
  ```

## modules

The modules to load.

* **Type**

  ```typescript theme={null}
  interface OverlayedOptions<TModule extends GameModule> {
  	modules: TModule[];
  }
  ```

* **Details**

  Modules allow you to subscribe to a specific game, including:

  * Game Events
  * Overlay Events like when the game launches

* **Example**

  ```typescript theme={null}
  import * as Siege from "@overlayed/app/siege";
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	modules: [Siege.module()],
  	// ...
  });
  ```

## keybinds

The app's keybinds

* **Type**

  ```typescript theme={null}
  interface OverlayedOptions<TKeybind extends string> {
  	keybinds: OverlayedAppKeybindsConfig<TKeybind>[];
  }

  type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<
  	TKeybind,
  	{
  		keys: OverlayedAppKeybindsConfigKey[];
  		mode: OverlayedAppKeybindsConfigMode;
  	}
  >;

  type OverlayedAppKeybindsConfigMode = "toggle" | "hold";
  type OverlayedAppKeybindsConfigKey =
  	| "ControlLeft"
  	| "AltLeft"
  	| "ShiftLeft"
  	| "AltRight"
  	| "ControlRight"
  	| "ShiftRight"
  	| (string & {});
  ```

* **Details**

  Keybinds require the array of
  [KeyboardEvent#code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) and the mode of the
  keybind.

  * "Hold" will trigger the callback when the keybind is held down.
  * "Toggle" will trigger the callback when the keybind is toggled on and off.

  Read more [here](/keybinds/introduction).

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	keybinds: {
  		toggleMainWindow: {
  			keys: ["ControlLeft", "KeyY"],
  			mode: "toggle",
  		},
  	},
  });
  ```

## init

* **Type**

  ```typescript theme={null}
  	init?: boolean;
  ```

* **Default:** `true`

* **Details**

  Whether to initialize the overlay right when the function is called. Read more [here](/advanced/delayed-init).

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	init: false,
  });
  ```

## universal

* **Type**

  ```typescript theme={null}
  	universal?: boolean;
  ```

* **Default:** `false`

* **Details**

  When true, the overlay will be loaded and attempt to render inside of all supported games. When false, only games
  registered under the `modules` array will be loaded.

  Read more [here](/essentials/overlay-events).

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	universal: true,
  });
  ```

## debug

* **Type**

  ```typescript theme={null}
  	debug?: boolean;
  ```

* **Default:** `false`

* **Details**

  When enabled:

  * logger.debug() logs will be printed and saved to the log file

  **Warning:** Debug mode should be disabled in production environments as it can impact performance and generate
  large log files.

  Read more about logging [here](/logging/introduction).

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	debug: process.env.NODE_ENV === "development",
  });
  ```

## featureFlags

A record of feature flag names to their default values. Keys provide typed access to remotely managed flags, values are
used as defaults before the API responds or when a flag is missing.

* **Type**

  ```typescript theme={null}
  featureFlags?: Record<string, boolean>;
  ```

* **Default:** `undefined`

* **Details**

  Registered flag names enable type-safe access via `overlay.featureFlags.get(flagName)` and
  `overlay.featureFlags.on(flagName, cb)`. Warnings are logged if a registered flag is not found in the API response.

  The `featureFlags` module also exposes a `ready` promise that resolves once the initial fetch completes. Read more
  [here](/feature-flags/introduction).

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	featureFlags: { "new-scoreboard": false, "beta-hud": false },
  });

  // Optionally wait for flags before proceeding
  await overlay.featureFlags.ready;

  if (overlay.featureFlags.get("new-scoreboard")) {
  	// Feature is enabled
  }
  ```

## site

* **Type**

  ```typescript theme={null}
  site?: {
  	manualUpdates?: boolean;
  };
  ```

* **Default:** `{ manualUpdates: false }`

* **Details**

  Configuration for site (frontend) updates.

  When `manualUpdates` is `true`, your site will not automatically update when a new version is deployed. Instead, you
  can listen for the `siteUpdateReady` event on `overlayed.updater.site` and prompt users to update.

  See [Site Updates](/deployment/updates) for more information.

* **Example**

  ```typescript theme={null}
  import { overlayed } from "@overlayed/app";

  const overlay = overlayed({
  	site: {
  		manualUpdates: true,
  	},
  });

  // Listen for new site versions
  overlay.updater.site.on("siteUpdateReady", ({ version }) => {
  	overlay.log.info(`New site version available: ${version}`);
  });
  ```
