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
| Property | Modifier | Type | Description |
|---|---|---|---|
hotkeys | public | IOverlayHotkeys | The hotkeys API used to register, update, and remove overlay hotkeys. See IOverlayHotkeys. |
version | readonly | string | The current version of the overlay package. Since 1.7.0 |
Methods
createWindow()
createWindow(options: OverlayWindowOptions): Promise<OverlayBrowserWindow>;
Create new Overlay window.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | OverlayWindowOptions | Window 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
| Parameter | Type |
|---|---|
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): OverlayBrowserWindow | null;
Returns the overlay window associated with a given BrowserWindow.
Parameters
| Parameter | Type | Description |
|---|---|---|
browserWindow | BrowserWindow | The Electron BrowserWindow to query. |
Returns
OverlayBrowserWindow | null
The corresponding overlay window or null if not owned by the overlay system.
See
fromWebContents()
fromWebContents(webContents: WebContents): OverlayBrowserWindow | null;
Returns the overlay window associated with a given WebContents instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
webContents | WebContents | The Electron WebContents to query. |
Returns
OverlayBrowserWindow | null
The corresponding overlay window or null if not found.
See
getActiveGameInfo()
getActiveGameInfo(): ActiveGameInfo | undefined;
Retrieves information about the currently active game, if available.
Returns
ActiveGameInfo | undefined
See
getAllWindows()
getAllWindows(): OverlayBrowserWindow[];
Get all open overlay windows.
Returns
An array of OverlayBrowserWindow instances.
See
getGpuPreference()
getGpuPreference(): Promise<GpuPreference>;
Returns the GPU preference currently recorded for this application's executable.
Resolves to 'default' when no entry exists — "no entry" and "let Windows decide"
are the same state, so this never resolves undefined.
Returns
Promise<GpuPreference>
A promise resolving to the recorded preference.
Throws
On a non-Windows platform.
See
Since
2.0.5
installHighElevationHelper()?
optional installHighElevationHelper(): Promise<void>;
Install ow-electron helpers to
%CommonProgramFiles%\<app-name> with UAC elevation.
Allows injection into high elevation games.
No-ops if files are already present.
Returns
Promise<void>
Resolves when installation completes.
Throws
HelperInstallError
exitCode 1223— user cancelled the UAC prompt (ERROR_CANCELLED)err.exitCode !== 1223— the installer process failed. Logerr.exitCodeand investigate.- any other non-zero exitCode — installation failed.
Remarks
The helper binaries are installed to:
%CommonProgramFiles%\<app-name>\owe-helper-ui.exe(x64)%CommonProgramFiles%\<app-name>\owe-helper-ui-x86.exe(x86)
Examples
// Check whether the helper is already installed
const installed: boolean = await api.isHighElevationHelperInstalled();
// Trigger UAC-elevated installation (shows a UAC prompt to the user)
try {
await api.installHighElevationHelper();
console.log("Helper installed successfully");
} catch (err: any) {
if (err.exitCode === 1223) {
// User cancelled the UAC prompt — not an error, just inform the user
console.warn("User cancelled UAC prompt");
} else {
console.error("Installation failed, exitCode:", err.exitCode);
}
}
async function ensureElevatedInjection(api: IOverwolfOverlayApi) {
const installed = await api.isHighElevationHelperInstalled();
if (!installed) {
await api.installHighElevationHelper(); // may throw — handle UAC cancel
}
// Injection into elevated games now happens automatically on game launch
}
isHighElevationHelperInstalled()?
optional isHighElevationHelperInstalled(): Promise<boolean>;
Returns true if ow-electron helpers is already installed in
%CommonProgramFiles%\<app-name>.
Returns
Promise<boolean>
true if the helper is installed and ready.
Example
const installed: boolean = await api.isHighElevationHelperInstalled();
if (!installed) {
// Prompt the user to run the one-time setup before injecting into elevated games
}
on("error")
on(eventName: "error", listener: (...args: any[]) => void): this;
Fires when an internal error occurs within the overlay system.
Parameters
| Parameter | Type |
|---|---|
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
| Parameter | Type | Description |
|---|---|---|
eventName | "game-launched" | The event identifier for when a game is launched. |
listener | (event: GameLaunchEvent, gameInfo: GameInfo) => void | Callback with game launch event and game metadata. |
Returns
this
See
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
| Parameter | Type | Description |
|---|---|---|
eventName | "game-exit" | The event identifier for when the game exits. |
listener | (gameInfo: GameInfo, wasInjected: boolean) => void | A 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
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
| Parameter | Type | Description |
|---|---|---|
eventName | "game-injected" | game-injected |
listener | (gameInfo: GameInfo) => void | Callback with game info. |
Returns
this
See
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
| Parameter | Type | Description |
|---|---|---|
eventName | "game-injection-error" | game-injection-error |
listener | (gameInfo: GameInfo, error: string, ...args: any[]) => void | Callback with game info, error message, and optional additional args. |
Returns
this