macos-touchid
v1.0.3
Published
Native module for working with macOS Local Authentication (eg. TouchID)
Downloads
238
Readme
macos-touchid
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