Web - Browser Intelligence

Integration Steps

  • Integrate JavaScript SDK in your frontend
  • Call API to query device information

Client integration

Please replace the variables and include the below snippet in the head section of your website.

<script>
var bureauHost = 'cdn.bureau.id' ;
var loader = document.createElement('script');
loader.type = 'text/javascript';
loader.async = true;
loader.src = `https://${bureauHost}/device.js`;
loader.onload = function () {
bContext = window._Bureau.createContext({
clientId: "<clientID>", //CHANGE THIS
sessionKey: txnid, // Please CHANGE this to pass server side
generated sessionKey and you will need this again for back-end API call
userIdHash: mobile, //CHANGE this to pass internal userId or hash of
email/phone. Dont
pass it if it's not available.
flow: location.pathname,
environment: "production",
parentElement: document.body,
 // called when bureau generates/restores deviceID for given device.
 onDeviceResponse: function (data) {
 console.log(` deviceID is ${data.deviceId}`);
 callback();
} });
  console.log(`context generated: ${bContext}`);
};
 var s = document.getElementsByTagName('script')[0]
 s.parentNode.insertBefore(loader, s);
 </script>

Add the block below in the HTML Body to handle cases where fraudster has
disabled JS and pass the appropriate values in "REPLACE-ME" from server side:

<noscript>
<img
src="https://<REPLACE-ME>/v1/a.png?clientId=<REPLACE-ME>&sessionKey=<RE
PLACE-ME>&flow=<REPLACE-ME>&ns=1"
style="display: none" />
</noscript>

_Bureau.createContext method returns context object. You can call updateConfig
method to dynamically update userIdHash and/or flow and/or sessionKey
parameters.

// set userIdHash after user logs in
bureauContext.updateConfig({ flow: newFlow, userIdHash:
newUserIdHash });
// reset userIdHash and set new sessionKey after log out
bureauContext.updateConfig({ flow: newFlow, userIdHash: null,
sessionKey: newSessionKey });

After submitting, you can use the /devices/ API call to get device details from the
Bureau Server.

Serverside URL's

Sandbox - https://api.overwatch.stg.bureau.id/v1/suppliers/device-intelligence
Production - https://api.overwatch.bureau.id/v1/suppliers/device-intelligence

Serverside call to get the details

curl --location --request POST '<https://api.overwatch.stg.bureau.id/v1/suppliers/device-intelligence>'  
--header 'Authorization: Basic MzN1ZWVkNWVmNg=='  
--header 'Content-Type: application/json'  
--data-raw '{  
    "sessionKey": "5fxxxx91-xxxx-4d68-xxxx-36ddxxx42c68",  
    "userIdHash": "123xxxx201"  
}'

Response

{
    "Browser": "Chrome",
    "DeviceAgeHours": "4922",
    "Emulator": false,
    "IpType": "Fixed Line ISP / Mobile ISP",
    "Model": "",
    "OS": "Mac OS X",
    "OSAnomaly": "low",
    "Proxy": "low",
    "RemoteSessionLevel": "",
    "RemoteSoftware": false,
    "RemoteSoftwareLevel": "low",
    "TamperedApp": "",
    "TrueIP": "14.143.179.162",
    "TrueOS": "Mac/iOS",
    "VPN": "low",
    "confidenceScore": 0.6896552,
    "deviceReputation": "medium_risk",
    "fingerprint": "9f1946be-xxxx-4f8a-xxxx-2781aa591808",
    "fingerprintConfidenceScore": 69,
    "id": "9b07e02c-7da2-4189-8298-3e572d8c9799",
    "ipLocationCity": "Bengaluru",
    "ipLocationCountry": "IN",
    "ipLocationLatitude": "12.98",
    "ipLocationLongitude": "77.60",
    "ipLocationRegion": "Karnataka",
    "merchantId": "auth0|61dfbxxxxxx20071be7021",
    "mobileUserId": null,
    "requestId": "5adf7f2a-xxxx-4e80-xxxx-4291a6def625",
    "sessionKey": "5f5f0b91-xxxx-4d68-xxxx-36dd41b42c68",
    "sessionRiskLevel": "low",
    "statusCode": 200,
    "timestamp": 1658401695480
}
{
  "data": null,
  "errors": {
    "status": 401,
    "errorCode": "UNAUTHORIZED",
    "service": "Overwatch"
  },
  "message": "",
  "meta": {
    "length": 0,
    "took": 0,
    "total": 0
  }
}
{
    "error": {
        "code": 422,
        "description": "No device found for given session.",
        "message": "NO_RECORD_FOUND",
        "metadata": null,
        "referenceId": "4dca8162-xxxx-42af-xxxx-b95c05f8c9d5",
        "type": "NO_RECORD_FOUND"
    },
    "merchantId": "auth0|61dfxxxxxx20071be7021",
    "requestId": "744b13ce-xxxx-407b-xxxx-f75e958bb527",
    "statusCode": 422,
    "timestamp": 1658401719187
}
{
  "error": {
    "code": 0,
    "description": "",
    "message": "Server encountered an error",
    "metadata": null,
    "referenceId": "86529a18-a5cb-4da9-91b0-8d04cdb9167e",
    "type": "INTERNAL_SERVER_ERROR"
  },
  "merchantId": "auth0|61dfbb6dfd33420071be7021",
  "requestId": "c69d86f0-1f08-4ef0-b151-e687d595a507",
  "statusCode": 500,
  "timestamp": 1657009043753
}