Package Exports
- electron-notarize
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (electron-notarize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Electron Notarize
Notarize your Electron apps seamlessly
Installation
# npm
npm i electron-notarize --save-dev
# yarn
yarn add electron-notarize --devWhat is app "notarization"?
From apple's docs, the definition of a "notarized app"
A notarized app is a macOS app that was uploaded to Apple for processing before it was distributed. When you export a notarized app from Xcode, it code signs the app with a Developer ID certificate and staples a ticket from Apple to the app. The ticket confirms that you previously uploaded the app to Apple.
On macOS 10.14 and later, the user can launch notarized apps when Gatekeeper is enabled. When the user first launches a notarized app, Gatekeeper looks for the app’s ticket online. If the user is offline, Gatekeeper looks for the ticket that was stapled to the app.
Basically Apple are going to make this a hard requirement soon, may as well get on the train early.
API
Method: notarize(opts): Promise<void>
optionsObjectappBundleIdString - The app bundle identifier your Electron app is using. E.g.com.github.electronappPathString - The absolute path to your.appfileappleIdString - The username of your apple developer accountappleIdPasswordString - The password for your apple developer account
Safety when using appleIdPassword
- Never hard code your password into your packaging scripts, use an environment variable at a minimum.
- It is possible to provide a keychain reference instead of your actual password. E.g.
const password = `@keychain:"Application Loader: ${appleId}"`;Example Usage
import { notarize } from 'electron-notarize';
async function packageTask () {
// Package your app here, and code side with hardened runtime
await notarize({
appBundleId,
appPath,
appleId,
appleIdPassword,
});
}