Building your first app
This article will take you step by step to scaffold your first app.
Prerequisites
Make sure you have these prerequisites installed before developing your app:
- Familiarity with Node.js, and JavaScript/TypeScript.
- An Integrated development environment (IDE). (for example, VSCode, IntelliJ, or other).
- Node.js version 18 or higher.
- Node package manager such as npm or Yarn.
- OW-Electron dependencies.
- Overwolf Sample app.
Make sure that all your prerequisites are configured and installed globally.
Scaffolding your first app
This section will get you started with building your first app.
Step 1: Download the sample app
Download the sample app from:
https://github.com/overwolf/ow-electron-packages-sample
App components
The sample app provided consists of the following components:
- Main process—acts as the application's entry point and runs in a Node.js environment.
- Renderer process—responsible for rendering web content and should behave according to web standards.
- Overwolf services—Overwolf specific APIs and services.
Step 2: Installing the prerequisites
To set up this app, you must first install its dependencies using yarn, npm, or any other package manager).
From within your project run:
- npm
- yarn
npm install
yarn
Step 3: Quick start
To run the app in development mode, simply run the build
script, followed by the start
script from the package.json
.
- npm
- yarn
npm run build
npm run start
yarn build
yarn start
- On Windows, make sure your command line has administrator privileges.
- After you have run the
npm run build
script, you can use the included.vscode/launch.json
file by pressingF5
on your keyboard (for default vscode settings).
Step 4: Production build
To build the app for production, you must run the build
script, followed by the build:ow-electron
script from the package.json. For example:
- npm
- Yarn
npm run build
npm run build:ow-electron
yarn build
yarn build:ow-electron
Customizing your app
Use the following sections to customize your app.
Adding/removing ow-electron packages
In order to add more/remove certain ow-electron packages from the project, simply edit the overwolf.packages
array in the package.json
file. For example:
{
...
"overwolf": {
"packages": [
"gep",
"overlay"
]
},
...
}
You can include the following packages:
- GEP—live game data events.
- Overlay—explanation here.
- Recorder—module used for screen recording apps. (currently in beta)
Unique app ID
Every Overwolf application (ow-electron or Overwolf native), has a unique app id. This unique id is automatically generated, and is based on the app's name, and the app's author's name.
In ow-electron
, these fields correspond to the following fields in the package.json file:
- App name - The
productName
(defaults toname
if missing) properties - App author - The
name
field under theauthor
field.
{
...
"name": "ow-electron-sample-app",
...
"author": {
"name": "Overwolf"
},
"productName": "real-ow-electron-sample-app",
...
"build": {
...
"productName": "unrelated-name-passed-to-builder",
...
},
...
}
Unique app ids are used for ads optimizations, as well as for optional anonymous analytics reports that you may review on our developer's console.
Fetching your app ID
Once your app has loaded, you can fetch the app ID through the API as follows:
import app from 'electron';
...
app.whenReady().then(() => {
const appID = process.env.OVERWOLF_APP_UID;
});
Note that this environment variable will only exist once the app is ready.
Monetizing your app
You have various methods of monetizing your app using Ow-electron. You can choose to show ads or build an app with a subscription model. For more information, see Monetize your app.
Run the sample app with the --test-ad
flag to enable Overwolf's test ad.
Anonymous analytics
Anonymous analytics report useful information to the developer console. From the console you can generate reports about different aspects of your app. This includes:
- Daily active users.
- Daily installs/uninstalls
- App crashes.
- Many more analytics.
For more information, see Anonymous analytics.
Next steps
Now that you have launched and customized the Overwolf sample app to your needs, you are ready to start to develop your app. Follow the App creation process and submit your idea and join an active developers community.
For more information about app development see:
- Best practices—best practices for developing your app.
- Monetizing your app—how you can monetize your app to support your development efforts
- Live game data—events and info to enrich your user experience.
- App creation process—submit your idea and join an active developers community.