Overwolf

Overwolf

  • Getting Started
  • Docs
  • API
  • Events Status
  • Blog
  • Q&A
  • Support

›Using Events

Best Practices

  • Overview
  • App specific experience
  • First time user experience
  • App launch performance
  • Marketing Communications
  • User journey and error handling
  • Per-game settings
  • Hotkey best practices
  • Second monitor usage
  • Data persistence
  • Reduce OPK size
  • Use Tab as an app Hotkey
  • Type definition file
  • Download Link with referral ID
  • Video capture best practices
  • Enable Developer Tools

Using Windows API

  • Using Overwolf windows
  • Windows Communication
  • Windows Types
  • Resolution Size and Position
  • General Tips

Using Plugins

  • Plugins overview
  • Plug-in Implementation
  • Write your own plugin
  • Sample plugin
  • Simple I/O plugin
  • TeamSpeak plugin
  • Downloader plugin
  • Process Manager plugin

Using Events

  • JavaScript events overview
  • Using game events in your app
  • Game events Simulator
  • Verifying event status

Developers Console

  • Submit a new version
  • Submit for review
  • Update store listing
  • Manage your subscriptions
  • Users and permissions
  • Crash reports
  • Rating and reviews

Integrations

  • Integrating app analytics
  • Login with Twitch
  • Login with Overwolf
  • Event SDK for Game Devs
  • Twitch Extensions

Request a Service

  • Marketing asset requirements
  • Looking for Group
  • Promoting your app
  • App recommendations

Community Help

  • Join the Community
  • Webinars
  • Developers Content
  • Code snippets

Legal

  • Legal overview
  • App terms
  • Developers terms
Edit

JavaScript events overview

In this basic overview we'll discuss javaScript events which fuel various Overwolf's APIs.

If you are familiar with JS events, and you want to learn how to use Overwolf game events, you can skip directly to the how to use Overwolf game events guide.

JS Events Basics

An event is an object that reacts when something interesting to you happens. Here’s an example of using the onStopStreaming event to be notified whenever a stream has stopped:

overwolf.streaming.onStopStreaming.addListener(
    function (value) {
        alert("a stream with id " + value.stream_id + " had stopped");
    }
);

As the example shows, you register for these alerts using addListener().

warning

We’ve seen situations where apps would register addListener multiple times for the same event – this caused the event to be triggered multiple times and causes unexpected bugs and memory leaks. Please pay attention when registering to events and prevent it.

You can also unregister from an event using the removeListener() function.

addListener(callback)

Version added: 0.78

Registers a listener to an event. When the event occurs, all registered listeners are called.

ParameterTypeDescription
callbackfunctionThe callback function to call when the event occurs

removeListener(callback)

Version added: 0.78

Unregister a listener to an event.

ParameterTypeDescription
callbackfunctionThe callback should be the same function that was passed to addListener()
so this won’t work with anonymous function
Last updated on 3/1/2020 by eransharv
← Process Manager pluginUsing game events in your app →
  • JS Events Basics
  • addListener(callback)
  • removeListener(callback)
  • Legal
  • Terms overview
  • Developer's terms
  • App terms
  • Overwolf terms
  • Overwolf Privacy policy
  • Support
  • Questions and Answers
  • Discord
  • Slack
  • Facebook
  • Twitter
  • Documentation
  • Changelog
  • API
  • App Creation Process
  • Best Practices
  • Game Events status
  • Information
  • Careers
  • Fund
  • Developers Blog
  • Overwolf Appstore
  • Advertise on Overwolf