Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

notarytool

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notarytool

A TypeScript implimentation of Apple's notarization process

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NotaryTool

build npm bundle size DeepScan grade

NotaryTool is a TypeScript implimentation of Apple's notarization process. The tool can be used on any platform and on macOS will attempt to staple on completion.

NotaryTool is supported by ON LX Limited. Check out our projects such as Ctrl Suite and bonjour-service.

Installation

Add to your project dependencies using Yarn or NPM.

Install with Yarn
yarn add notarytool
Install with NPM
npm install notarytool

Usage

import NotaryTool from 'notarytool'

/**
 *  Setup the tool using API credentials 
 */
const tool = new NotaryTool({
    appleApiKey         : process.env.APPLE_API_KEY,
    appleApiKeyId       : process.env.APPLE_API_KEY_ID,
    appleApiIssuerId    : process.env.APPLE_API_ISSUER_ID
})

/**
 * Monitor the current status of the tool
 */
tool.on('progress', val => console.log('progress:', val))
tool.on('status', (status, message) => console.log('status:', status, message))

/**
 * Call notarize with the file path
 */
try {
    await tool.notarize(process.env.FILE_PATH)
    console.log('Success')
} catch(error) {
    console.log('Failed', error)
}

API

Initializing

const tool = new NotaryTool(options: NotaryToolConfig)

Creates an new tool instance that can handle notarizing multiple times

Options are:

  • @string appleApiKey The file path to the AuthKey_{id}.p8 file from the App Store
  • @string appleApiKeyId The {id} of the AuthKey file
  • @string appleApiIssuerId The issuer ID provided by the App Store
  • @boolean? ignoreStaple If enabled on macOS, staple stage will be skipped

Methods

await tool.notarize(filePath: string)

Begins the file notarization process. Function returns a void on success and throws errors

Events

tool.on('progress', (val: number) => console.log(val))

Provides progress of process from 0.0 to 1.0. Value will hang around 0.75 whilst response from App Store is provided.

tool.on('status', (status: NotaryToolStatus, message: string | undefined) => console.log(status, message))

Provides a status value and optional readable message where applicable.

Enums

NotaryToolStatus
enum NotaryToolStatus {
    BeginUpload     = 'begin_upload',
    Uploaded        = 'uploaded',
    Invalid         = 'invalid',
    InProgress      = 'in_progress',
    Complete        = 'complete'
}

Keywords

FAQs

Package last updated on 27 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc