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.2.36/verosintjs.umd.js"></script>The version in the above example is likely not up-to-date as the library is updated at least once a week. The version in the example is there for illustration purposes only. The current version string of the library can be seen at the NPM registry. It is recommended to use the latest version.
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)Updated 17 days ago