0.3.0 • Published 4 months ago
honeypot-run v0.3.0
honeypot-npm
This repo contains the npm
module for installing Honeypot.
https://www.npmjs.com/package/honeypot-run
Installing
npm i honeypot-run
Usage
// configure the async script URL
honeypot.load('https://your-honeypot/js');
// optionally link the honeypot identity to a user
honeypot.identify('user123', {'name': 'John'}, 'account')
// listen for flags
honeypot.on('flag', (flag) => {
// do something with the flag
console.log('flag received', flag)
})
// track an event called 'Page visit'
honeypot.track('Page visit')
// or, if you want to associate the event with additional properties
honeypot.track('Page visit', {'foo': 'bar'})
// get the user information, including their handprint
honeypot.get().then((honey) => {
console.log('Got honey!', honey);
})