Native module for working with macOS Local Authentication (eg. TouchID)
npm install macos-touchidmacos-touchid
> Native module for working with macOS Local Authentication (eg. TouchID)
``js
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')
})
`
Check if authentication is available
Attempt to authenticate
`sh``
npm install macos-touchid