Skip to main content

overwolf.notifications API

Use this API to send toast notifications from your OW app.

Toast are interactive OS notifications that lets you create flexible "reminders" with text, images, and buttons/inputs. Toast notifications are a combination of some data properties like header, visual (hero image, inline image, app logo) and the toast content.

Note that currently using toast on an unpacked app does NOT work.

Methods Reference​

Events Reference​

Types Reference​

showToastNotification(args, callback)​

Version added: 0.176​

Show Windows toast notification.

ParameterTypeDescription
argsToastNotificationParams objectToast notification params
callback(Result: ShowToastNotificationResult) => voidReturns with the result

Usage example​

overwolf.notifications.showToastNotification({
header: "Header",
texts: ["text1", "text2"],
buttons: [
{ id: "button_1", text: "button 1" },
{ id: "button_2", text: "button 2" }
]
}, console.log);

The above line of code triggers this notification:

notification-example

Protocol activation example​

// Register "protocol_override_domains": { "myapp": "myapp://" } in your manifest

// At app startup, listen for URI activations:
overwolf.extensions.onAppLaunchTriggered.addListener(({ origin, parameter }) => {
if (origin === "urlscheme") {
const url = new URL(parameter);
if (url.pathname === "//open-replay") openReplayView(url.searchParams.get("id"));
}
});

// Show a toast that routes through onAppLaunchTriggered when clicked:
overwolf.notifications.showToastNotification({
texts: ["Match saved!", "Click to review your last game"],
activationType: "protocol",
launch: "myapp://open-replay?id=abc123",
buttons: [{
id: "review",
text: "Review now",
activationType: "protocol",
launch: "myapp://open-replay?id=abc123&autoplay=true",
}],
}, console.log);

ToastNotificationParams Object​

ParameterTypeDescription
headerstringSee notes
textsstring[]Mandatory. See notes.
logoOverrideLogoOverride objectSee notes.
heroImagestringSee notes.
inlineImagestringSee notes
attributionstringSee notes
buttonsToastNotificationButton[]See notes.
activationTypestringSee notes
launchstringSee notes

header notes​

You can provide a headline to the notificaiton.

texts notes​

Texts parameter must exist and include 1-3 texts (lines).

logoOverride notes​

By default, your toast will display your app's logo. However, you can override this logo with your own image.

heroImage notes​

Toasts can display a hero image, which is displayed prominently within the toast banner and while inside Action Center. Image dimensions must be 364x180 pixels.

inlineImage notes​

You can provide a full-width inline-image that appears when you expand the toast.

attribution notes​

If you need to reference the source of your content, you can use attribution text. This text is always displayed at the bottom of your notification, along with your app's identity or the notification's timestamp.

buttons notes​

Buttons make your toast interactive, letting the user take quick actions on your toast notification without interrupting their current workflow. Buttons appear in the expanded portion of your notification.

activationType notes​

Controls what happens when the user clicks the toast body.

  • foreground (default) — fires the in-process onToastInteraction event.
  • protocol — Windows invokes the URI set in launch via the registered URL scheme. Routes to overwolf.extensions.onAppLaunchTriggered even if the app is not running.

launch notes​

The URI to invoke when activationType is "protocol". Must match a scheme registered in your app manifest under protocol_override_domains.

ToastNotificationButton Object​

ParameterTypeDescription
idstring
textstring
activationTypestring"protocol" — invokes the URI in launch via onAppLaunchTriggered. Omit for default onToastInteraction behavior.
launchstringURI invoked when activationType is "protocol".

LogoOverride Object​

Note: Must be 364x180.

ParameterTypeDescription
urlstring
cropTypeAppLogoCrop enum

ShowToastNotificationResult Object​

ParameterTypeDescription
successbooleaninherited from the "Result" Object
errorstringinherited from the "Result" Object
idstring

AppLogoCrop enum​

Version added: 0.176​

Specify the desired cropping of the image.

OptionValueDescription
Default"Default"Cropping uses the default behavior of the renderer.
None"None"Image is not cropped.
Circle"Circle"Image is cropped to a circle shape.

onToastInteraction​

Version added: 0.176​

Fired when a user tapped on the body of a toast notification or performed an action inside a toast notification, with the following structure: ToastNotificationEvent Object.

ToastNotificationEvent Object​

ParameterTypeDescription
idstring
eventTypeToastEventType enum
buttonIDstring
errorstring
errorCodeToastEventError enum

ToastEventType enum​

Version added: 0.176​

Describes the toast event type.

OptionValueDescription
Dismiss"dismiss"
ButtonClick"buttonClick"
Error"error"

ToastEventError enum​

Version added: 0.176​

Describes the toast event error.

OptionValueDescription
Unknown"unknown"
NotificationsDisabled"notificationsDisabled "
Error"error"