Add VerosintJS to Your Application

The VerosintJS library enables capturing a fingerprint when your application is accessed. The VerosintJS library can be imported into your app using the following snippet:

<script src="https://cdn.verosint.com/verosintjs/0.0.7/verosintjs.umd.js"></script>

To generate the device ID, call the getDeviceId() function from the library. The call returns a promise. Typically, the application will need a code similar to this example:

VerosintJS.getDeviceId().then((id) => {
		// execute login code here and pass the id to the login provider
  }
);

The login provider or server side code upon receiving the device ID, can submit the event to the SignalPrint events service and set the deviceId identifier to the received value. The following is a Python example:

import requests

url = "https://api.verosint.com/v1/signalprint/events"
verosint_api_key = "<PUT YOUR KEY HERE>"

payload = [
    {
        "type": "LOGIN_SUCCESS",
        "ip": "172.56.89.52",
        "email": "[email protected]",
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36",
        "deviceId": verosintDeviceId, # the received device ID from the client side app 
        "accountId": "babsjensen"
    }
]
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": verosint_api_key
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)