{"name":"@electron/notarize","version":"3.1.0","author":{"name":"Samuel Attard"},"license":"MIT","_id":"@electron/notarize@3.1.0","maintainers":[{"name":"electron-cfa","email":"info+cfa-npm@electronjs.org"}],"homepage":"https://github.com/electron/notarize#readme","bugs":{"url":"https://github.com/electron/notarize/issues"},"dist":{"shasum":"43f5a6371b337fd34c8278297e80666c956cbd28","tarball":"http://registry-npm.ywwl.com/@electron/notarize/download/@electron/notarize-3.1.0.tgz","fileCount":27,"integrity":"sha512-DHePlWvmUKTNok2+yoOp2ZZ+3ZaLlDWdWD43BfzZhRlUPrBs+EwXDBq3kTJlO+jw2KZzeC3GGlypgw4HQZTD5w==","signatures":[{"sig":"MEUCIEdD0fPGiMpd5VItTX+r0fZNpDqtdeOi2+LDUNCzTMvZAiEAhH0VS4xt+qymo6ayTdf3qY+CRrLkUDyYg21wE8zXj3g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@electron%2fnotarize@3.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":42091,"size":12370,"noattachment":false,"key":"/@electron/notarize/-/@electron/notarize-3.1.0.tgz"},"type":"module","engines":{"node":">= 22.12.0"},"exports":"./lib/index.js","gitHead":"a0f6912bc8a56274bf54f037ceea128c9809b5f9","scripts":{"lint":"prettier --check \"src/**/*.ts\"","test":"vitest run","build":"tsc","prepare":"yarn build","build:docs":"npx typedoc","prettier:write":"prettier --write \"src/**/*.ts\""},"typings":"lib/index.d.ts","_npmUser":{"name":"electron-cfa","email":"info+cfa-npm@electronjs.org"},"repository":{"url":"git+https://github.com/electron/notarize.git","type":"git"},"_npmVersion":"10.9.0","description":"Notarize your Electron app","directories":{},"_nodeVersion":"22.12.0","dependencies":{"debug":"^4.4.0","promise-retry":"^2.0.1"},"publishConfig":{"provenance":true},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.8","typedoc":"~0.25.13","prettier":"^3.4.2","typescript":"~5.4.5","@types/node":"~22.10.7","@types/debug":"^4.1.12","@tsconfig/node22":"^22.0.0","@types/promise-retry":"^1.1.3","typedoc-plugin-missing-exports":"^2.2.0"},"_npmOperationalInternal":{"tmp":"tmp/notarize_3.1.0_1756839864461_0.9087237027042594","host":"s3://npm-registry-packages-npm-production"},"readme":"Electron Notarize\n-----------\n\n> Notarize your Electron apps seamlessly for macOS\n\n[![Test](https://github.com/electron/notarize/actions/workflows/test.yml/badge.svg)](https://github.com/electron/notarize/actions/workflows/test.yml)\n[![NPM package](https://img.shields.io/npm/v/@electron/notarize)](https://npm.im/@electron/notarize)\n\n## Installation\n\n```bash\nnpm install @electron/notarize --save-dev\n```\n\n## What is app \"notarization\"?\n\nFrom Apple's docs in XCode:\n\n> A notarized app is a macOS app that was uploaded to Apple for processing before it was distributed.\n> When you export a notarized app from Xcode, it code signs the app with a Developer ID certificate\n> and staples a ticket from Apple to the app. The ticket confirms that you previously uploaded the app to Apple.\n\n> On macOS 10.14 and later, the user can launch notarized apps when Gatekeeper is enabled.\n> When the user first launches a notarized app, Gatekeeper looks for the app’s ticket online.\n> If the user is offline, Gatekeeper looks for the ticket that was stapled to the app.\n\nAs macOS 10.15 (Catalina), Apple has made notarization a hard requirement for all applications\ndistributed outside of the Mac App Store. App Store applications do not need to be notarized.\n\n## Prerequisites\n\nFor notarization, you need the following things:\n\n1. Xcode 13 or later installed on your Mac.\n1. An [Apple Developer](https://developer.apple.com/) account.\n1. [An app-specific password for your ADC account’s Apple ID](https://support.apple.com/HT204397).\n1. Your app may need to be signed with `hardenedRuntime: true` option, with the `com.apple.security.cs.allow-jit` entitlement.\n\n> [!NOTE]\n> If you are using Electron 11 or below, you must add the `com.apple.security.cs.allow-unsigned-executable-memory` entitlement too.\n> When using version 12+, this entitlement should not be applied as it increases your app's attack surface.\n\n\n## API\n\n`@electron/notarize` exposes a single `notarize` function that accepts the following parameters:\n* `appPath` — the absolute path to your codesigned and packaged Electron application.\n* `notarytoolPath` - String (optional) - Path to a custom notarytool binary ([more details](#custom-notarytool)) \n* additional options required for authenticating your Apple ID (see below)\n\nThe method returns a void Promise once app notarization is complete. Please note that notarization may take\nmany minutes.\n\nIf the notarization process is unusually long for your application, see Apple Developer's docs to\n[Avoid long notarization response times and size limits](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow#3561440).\n\n### Usage with app-specific password\n\nYou can generate an [app-specific password](https://support.apple.com/en-us/102654) for your Apple ID\nto notarize your Electron applications.\n\nThis method also requires you to specify the [Team ID](https://developer.apple.com/help/account/manage-your-team/locate-your-team-id/)\nof the Developer Team you want to notarize under. An Apple ID may be part of multiple Teams.\n\n```javascript\nimport { notarize } from '@electron/notarize';\n\nawait notarize({\n  appPath,\n  appleId, // Login name of your Apple Developer account\n  appleIdPassword, // App-specific password\n  teamId, // Team ID for your developer team\n});\n```\n\n> [!IMPORTANT]\n> **Never hard code your app-specific password into your packaging scripts.** Use an environment\n> variable at a minimum.\n\n### Usage with App Store Connect API key\n\nAlternatively, you can also authenticate via JSON Web Token (JWT) with App Store Connect.\n\nYou can obtain an API key from [App Store Connect](https://appstoreconnect.apple.com/access/integrations/api).\nCreate a **Team Key** with **App Manager** access.\n\nNote down the Issuer ID (UUID format) and Key ID (10-character alphanumeric string),\nand download the `.p8` API key file (`AuthKey_<appleApiKeyId>.p8`).\nFor security purposes, the private key can only be downloaded once.\n\nProvide the absolute path to your API key as the `appleApiKey` argument.\n\n```javascript\nimport { notarize } from '@electron/notarize';\n\nawait notarize({\n  appPath,\n  appleApiKey, // Absolute path to API key (e.g. `/path/to/AuthKey_X0X0X0X0X0.p8`)\n  appleApiIssuer, // Issuer ID (e.g. `d5631714-a680-4b4b-8156-b4ed624c0845`)\n});\n```\n\nYou can alternatively use an [individual API key](https://developer.apple.com/documentation/appstoreconnectapi/creating-api-keys-for-app-store-connect-api#Generate-an-Individual-Key) if (and only if) you are using Xcode 26+. When using an individual API key, it is imperative that you omit `appleApiIssuer` (issuer ID); otherwise you will receive a \"401 Unauthorized\" response from the server.\n\n### Usage with Keychain credentials\n\nAs an alternative to passing authentication options, you can also store your authentication\ncredentials (for both API key and app-specific password strategies) in the macOS Keychain\nvia the `xcrun notarytool` command-line utility.\n\nThis method has the advantage of validating your notarization credentials before submitting\nyour application for notarization.\n\nFor example:\n\n```sh\n# App-specific password strategy\nxcrun notarytool store-credentials \"my-app-password-profile\"\n  --apple-id \"<AppleID>\"\n  --team-id <DeveloperTeamID>\n  --password <app_specific_password>\n```\n\n```sh\n# App Store Connect API key strategy\nxcrun notarytool store-credentials \"my-api-key-profile\"\n  --key \"<PathToAPIKey>\"\n  --key-id <KeyID>\n  --issuer <IssuerID>\n```\n\nSuccessful storage of your credentials will look like this:\n\n```\nThis process stores your credentials securely in the Keychain. You reference these credentials later using a profile name.\n\nValidating your credentials...\nSuccess. Credentials validated.\nCredentials saved to Keychain.\nTo use them, specify `--keychain-profile \"my-api-key-profile\"`\n```\n\nAfter successfully storing your credentials, pass the keychain profile name into\nthe `keychainProfile` parameter.\n\n```javascript\nimport { notarize } from '@electron/notarize';\n\nawait notarize({\n  appPath,\n  keychainProfile,\n});\n```\n\n### Custom notarytool\n\nYou can provide a path to a custom `notarytool`. This module allows this option to enable unique edge cases - but this use case is _explicitly unsupported_. \n\n## Troubleshooting\n\n### Debug logging\n\n[`debug`](https://www.npmjs.com/package/debug) is used to display logs and messages.\nRun your notarization scripts with the `DEBUG=electron-notarize*` environment variable to log additional\ndebug information from this module.\n\n### Validating credentials\n\nWhen notarizing your application, you may run into issues with validating your notarization\ncredentials.\n\n```\nError: HTTP status code: 401. Invalid credentials. Username or password is incorrect.\nUse the app-specific password generated at appleid.apple.com. Ensure that all authentication arguments are correct.\n```\n\n[Storing your credentials in Keychain](#usage-with-keychain-credentials) will validate your credentials before\neven GitHub.\n\n### Validating app notarization\n\nTo validate that notarization worked, you can use the `stapler` command-line utility:\n\n```sh\nstapler validate path/to/notarized.app\n```\n\n### Apple documentation\n\nApple also provides additional debugging documentation on\n[Resolving common notarization issues](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues).\n","publish_time":1756839864668,"_cnpm_publish_time":1756839864668,"dist-tags":{"latest":"3.1.2"}}