package.json
This page is only intended to serve as a quick reference to the package.json changes required to use @overwolf/ow-electron. For more information about the the package itself, click here.
Included is a list of important package.json changes that should be included when working with the @overwolf/ow-electron package.
Start and Build
Creating new npm start
and build
commands, for testing and building your app:
{
...
"scripts": {
...
"start:ow-electron": "ow-electron .",
"build:ow-electron": "ow-electron-builder --publish=never"
},
...
}
Author.name and App name
Every Overwolf application (ow-electron or Overwolf platform), 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",
...
},
...
}
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.