Skip to main content

IOverwolfOverlayApi

Electron APIs / overlay / IOverwolfOverlayApi

APIs for managing Overwolf overlay windows, hotkeys, input modes, and game integration.

Enables apps to:

  • Register and track game activity.
  • Inject overlays into supported games.
  • Manage hotkeys.
  • Control input interception behavior.

Extends the EventEmitter interface to allow for subscription to overlay-related events such as game launch, focus changes, and input mode transitions.

Example

private _overlayApi: IOverwolfOverlayApi;

this._overlayApi.on('game-launched', (event, gameInfo) => {
if (gameInfo.supported === true) {
event.inject();
}
});

Extends

  • EventEmitter

Properties

PropertyModifierTypeDescription
hotkeyspublicIOverlayHotkeysThe hotkeys API used to register, update, and remove overlay hotkeys. See IOverlayHotkeys.
versionreadonlystringThe current version of the overlay package. Since 1.7.0

Methods

createWindow()

createWindow(options: OverlayWindowOptions): Promise<OverlayBrowserWindow>;

Create new Overlay window.

Parameters

ParameterTypeDescription
optionsOverlayWindowOptionsWindow configuration including name, z-order, passthrough, etc.

Returns

Promise<OverlayBrowserWindow>

A promise that resolves to the created OverlayBrowserWindow.

See


enterExclusiveMode()

enterExclusiveMode(options?: ExclusiveInputOptions): void;

Enters Overlay "Exclusive Mode" to intercept user input in games where the mouse cursor is not visible.

The game-input-exclusive-mode-changed event fires if exclusive mode was entered.

NOTE: This is only supported when getActiveGameInfo().gameInputInfo.canInterceptInput is false. Calling this function when unsupported will be ignored and will not throw an exception.

Parameters

ParameterType
options?ExclusiveInputOptions

Returns

void


exitExclusiveMode()

exitExclusiveMode(): void;

Exits Overlay "Exclusive Mode", allowing user input to be sent to the game.

This is only effective if getActiveGameInfo().gameInputInfo.canInterceptInput is true.

Returns

void


fromBrowserWindow()

fromBrowserWindow(browserWindow: BrowserWindow): null | OverlayBrowserWindow;

Returns the overlay window associated with a given BrowserWindow.

Parameters

ParameterTypeDescription
browserWindowBrowserWindowThe Electron BrowserWindow to query.

Returns

null | OverlayBrowserWindow

The corresponding overlay window or null if not owned by the overlay system.

See

OverlayBrowserWindow.


fromWebContents()

fromWebContents(webContents: WebContents): null | OverlayBrowserWindow;

Returns the overlay window associated with a given WebContents instance.

Parameters

ParameterTypeDescription
webContentsWebContentsThe Electron WebContents to query.

Returns

null | OverlayBrowserWindow

The corresponding overlay window or null if not found.

See

OverlayBrowserWindow.


getActiveGameInfo()

getActiveGameInfo(): undefined | ActiveGameInfo;

Retrieves information about the currently active game, if available.

Returns

undefined | ActiveGameInfo

See

ActiveGameInfo.


getAllWindows()

getAllWindows(): OverlayBrowserWindow[];

Get all open overlay windows.

Returns

OverlayBrowserWindow[]

An array of OverlayBrowserWindow instances.

See

OverlayBrowserWindow.


on("error")

on(eventName: "error", listener: (...args: any[]) => void): this;

Fires when an internal error occurs within the overlay system.

Parameters
ParameterType
eventName"error"
listener(...args: any[]) => void
Returns

this

on("game-launched")

on(eventName: "game-launched", listener: (event: GameLaunchEvent, gameInfo: GameInfo) => void): this;

Fires when a registered game is launched. Call event.inject() to enable the overlay for the game.

Parameters
ParameterTypeDescription
eventName"game-launched"The event identifier for when a game is launched.
listener(event: GameLaunchEvent, gameInfo: GameInfo) => voidCallback with game launch event and game metadata.
Returns

this

See

GameInfo.

on("game-exit")

on(eventName: "game-exit", listener: (gameInfo: GameInfo, wasInjected: boolean) => void): this;

Fires when a registered game process terminates.

Useful for performing cleanup, UI updates, or closing overlay windows.

Parameters
ParameterTypeDescription
eventName"game-exit"The event identifier for when the game exits.
listener(gameInfo: GameInfo, wasInjected: boolean) => voidA callback function that receives the game info of the exited game.
Returns

this

Example
overlay.on("game-exit", (gameInfo, wasInjected) => {
console.log(
`Game exited: ${gameInfo.title} and ${wasInjected ? "was injected" : "was not injected"}`,
);
closeOverlayWindows();
});
See

GameInfo.

on("game-injected")

on(eventName: "game-injected", listener: (gameInfo: GameInfo) => void): this;

Fires when the overlay is ready and successfully injected into the game.

Parameters
ParameterTypeDescription
eventName"game-injected"game-injected
listener(gameInfo: GameInfo) => voidCallback with game info.
Returns

this

See

GameInfo.

on("game-injection-error")

on(eventName: "game-injection-error", listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void): this;

Fires when overlay injection into the game fails.

Parameters
ParameterTypeDescription
eventName"game-injection-error"game-injection-error
listener(gameInfo: GameInfo, error: string, ...args: any[]) => voidCallback with game info, error message, and optional additional args.
Returns

this

See

GameInfo.

on("game-focus-changed")

on(eventName: "game-focus-changed", listener: (window: GameWindowInfo, gameInfo: GameInfo, focus: boolean) => void): this;

Fires when the game window focus state changes.

Parameters
ParameterTypeDescription
eventName"game-focus-changed"game-focus-changed
listener(window: GameWindowInfo, gameInfo: GameInfo, focus: boolean) => voidCallback with window info, game info, and focus state.
Returns

this

See

on("game-window-changed")

on(eventName: "game-window-changed", listener: (window: GameWindowInfo, gameInfo: GameInfo, reason?: GameWindowUpdateReason) => void): this;

Fires when the game window is resized or changes position.

Parameters
ParameterTypeDescription
eventName"game-window-changed"game-window-changed
listener(window: GameWindowInfo, gameInfo: GameInfo, reason?: GameWindowUpdateReason) => voidCallback with window info, game info, and optional reason.
Returns

this

See

on("game-input-interception-changed")

on(eventName: "game-input-interception-changed", listener: (info: GameInputInterception) => void): this;

Fires when the game input interception capability changes.

Parameters
ParameterTypeDescription
eventName"game-input-interception-changed"game-input-interception-changed
listener(info: GameInputInterception) => voidCallback with updated input state.
Returns

this

See

GameInputInterception.

on("game-input-exclusive-mode-changed")

on(eventName: "game-input-exclusive-mode-changed", listener: (info: GameInputInterception) => void): this;

Fires when exclusive input mode state changes.

Parameters
ParameterTypeDescription
eventName"game-input-exclusive-mode-changed"game-input-exclusive-mode-changed
listener(info: GameInputInterception) => voidCallback with input mode details.
Returns

this

See

GameInputInterception.


registerGames()

registerGames(filter: GamesFilter): any;

Register games to track for overlay injection.

Parameters

ParameterTypeDescription
filterGamesFilterConfiguration specifying which games to register and whether to include unsupported titles.

Returns

any

See

GamesFilter.