1.0.3 • Published 5 years ago

macos-touchid v1.0.3

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

macos-touchid

Build Status

Native module for working with macOS Local Authentication (eg. TouchID)

Usage

var touchid = require('macos-touchid')

if (touchid.canAuthenticate() === false) {
  throw new Error('No authentication method available')
}

touchid.authenticate('authenticate you', function (err, didAuthenticate) {
  if (err) throw err

  console.log(didAuthenticate ? `You're in!` : 'You will be terminated')
})

API

const bool = touchid.canAuthenticate()

Check if authentication is available

touchid.authenticate(reason, cb(err, bool))

Attempt to authenticate

Install

npm install macos-touchid

License

ISC