What is @electron/notarize?
@electron/notarize is an npm package designed to help developers notarize their Electron applications for macOS. Notarization is a process by which Apple scans your app for malicious content and checks for code-signing issues. This package simplifies the process of submitting your app to Apple's notarization service and retrieving the results.
What are @electron/notarize's main functionalities?
Notarize an Electron App
This feature allows you to notarize your Electron application by providing the app bundle ID, the path to your app, and your Apple ID credentials. The function `notarize` handles the submission to Apple's notarization service.
const { notarize } = require('@electron/notarize');
async function notarizeApp() {
await notarize({
appBundleId: 'com.example.app',
appPath: '/path/to/your/app.app',
appleId: 'your-apple-id@example.com',
appleIdPassword: 'your-apple-id-password'
});
}
notarizeApp().catch(console.error);
Check Notarization Status
This feature allows you to check the status of a notarization request by providing the request UUID and your Apple ID credentials. The function `checkNotarizationStatus` retrieves the current status of the notarization process.
const { checkNotarizationStatus } = require('@electron/notarize');
async function checkStatus(requestUUID) {
const status = await checkNotarizationStatus({
requestUUID,
appleId: 'your-apple-id@example.com',
appleIdPassword: 'your-apple-id-password'
});
console.log(status);
}
checkStatus('your-request-uuid').catch(console.error);
Staple Notarization Ticket
This feature allows you to staple the notarization ticket to your Electron application. The function `stapleApp` ensures that the notarization ticket is attached to your app, which is required for distribution.
const { stapleApp } = require('@electron/notarize');
async function staple() {
await stapleApp({
appPath: '/path/to/your/app.app'
});
}
staple().catch(console.error);
Other packages similar to @electron/notarize
electron-osx-sign
electron-osx-sign is a package that provides code-signing capabilities for macOS Electron applications. While it focuses on code-signing, it also offers notarization features. However, @electron/notarize is more specialized and streamlined for the notarization process.
electron-builder
electron-builder is a comprehensive package for building and packaging Electron applications. It includes features for code-signing and notarization, among many other functionalities. While it is more feature-rich, @electron/notarize is more focused and easier to use specifically for notarization tasks.