Skip to main content

IOverwolfCRNApi

Electron APIs / crn / IOverwolfCRNApi

Interface for interacting with the Overwolf Content Recommendation Notification (CRN) system.

Provides methods to query notification state, control visibility, and respond to notification events.

Extends EventEmitter, so once, off and removeListener are also available.

Extends​

  • EventEmitter

Methods​

allowNotifications()​

allowNotifications(enable: boolean): Promise<void>;

Enable or disable notifications.

Parameters​

ParameterTypeDescription
enablebooleantrue to enable notifications, false to disable.

Returns​

Promise<void>

A promise that resolves once the setting has been applied.


closeNotificationWindow()​

closeNotificationWindow(): void;

Closes the notification.

Returns​

void


getNotificationStatus()​

getNotificationStatus(): Promise<boolean>;

Returns Notification settings status. true if notifications are allowed, false if not.

Returns​

Promise<boolean>


isNotificationVisible()​

isNotificationVisible(): Promise<boolean>;

Returns Notification visible status. true if the notification is currently visible, false if not.

Returns​

Promise<boolean>


on("before-notification")​

on(eventName: "before-notification", listener: (event: ICRNEvent, args?: undefined) => void): this;

Fires before a notification is shown. Typically used to abort a notification (e.g., inappropriate timing).

Parameters​
ParameterTypeDescription
eventName"before-notification"'before-notification'
listener(event: ICRNEvent, args?: undefined) => voidCalled synchronously before the notification is shown. Call event.abort() inside the listener to prevent the notification from showing. The second args parameter is always undefined; it is kept only so existing two-parameter listeners still compile.
Returns​

this

on("notification-action")​

on(eventName: "notification-action", listener: (action: CRNActionType) => void): this;

Fires when a notification action is triggered.

Parameters​
ParameterTypeDescription
eventName"notification-action"'notification-action'
listener(action: CRNActionType) => voidReceives the CRNActionType describing what happened to the notification.
Returns​

this