handprint
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

HandprintJS

This repo contains the npm module for installing HandprintJS.

https://www.npmjs.com/package/handprintjs

Installing

npm i handprintjs

Usage

// Required: initialize the library
// Note: you can find your handprint endpoint by logging into your account
handprint.load('https://your-handprint-endpoint/js');

// (Optional) link the handprint to an account
handprint.identify('user123', {'name': 'John'}, 'account')

// (Optional) listen for flags
handprint.on('flag', (flag) => {
    // do something with the flag
    console.log('flag received', flag)
})

// Required: track an event
// e.g. 'Page visit', 'Sign up', 'Product review', 'Load application', etc
handprint.track('Page visit')

// or, if you want to associate the event with additional properties
handprint.track('Page visit', {'foo': 'bar'})

// Get the user information, including their handprint
handprint.get().then((visitorInfo) => {
    console.log(visitorInfo);
})

Dependents (0)

Package Sidebar

Install

npm i handprint

Weekly Downloads

1

Version

0.1.0

License

BUSL-1.1

Unpacked Size

4.25 kB

Total Files

5

Last publish

Collaborators

  • honeypot-run