How to sign electron app using electron forge?

electronPackagerConfig is now packagerConfig, e.g.:

{ 
  "config": {
    "forge": {
      "packagerConfig": {
        "osxSign": {
          "identity": "Developer ID Application: Company (id)"
        }
      }
    }
  }
}


EDIT: see https://stackoverflow.com/a/58665415/2165342 bellow. electronPackagerConfig is now packagerConfig

Use packagerConfig key in your package.json.

Electron Forge uses Electron Packager under the hood and allows you to set the Electron Packager configuration in your package.json.

Here's an extract of what mine looks like in order to sign our packaged application file:

package.json

{ 
  "config": {
    "forge": {
      "packagerConfig": {
        "osxSign": {
          "identity": "Developer ID Application: Joshua Pinter (<your_key_code>)"
        }
      }
    }
  }
}

You can see that all the Electron Packager configurations can be put under the packagerConfig key.

NOTE: In older versions of Electron Forge, this was called electronPackagerConfig instead of packagerConfig.