@boomid/core
v0.1.26
Published
Ditch the Password, Palm It!
Downloads
9
Keywords
Readme
Installing
The BoomID Core SDK can be installed via NPM:
npm install --save @boomid/core
or added as a script tag:
<head>
<script src="https://unpkg.com/@boomid/core"></script>
</head>
Modules
GetDevicePrint
import { GetDevicePrint } from '@boomid/core';
GetDevicePrint()
.then((response) => {
console.log('Device Print is: ', response);
})
.catch((error) => {
console.error('An error has occurred: ', error);
})
Options
You may disable Geolocation collection by setting the disableGeolocation
parameter to true
.
This is beneficial for multiple purposes:
- Increase speed of gathering a Device Print
- Disable prompt for the user to approve gathering of location data within the browser
GetDevicePrint({
disableGeolocation: true // Defaults to false
})
SubmitEvidence
Submit evidence to the BoomID Identity Assurance Engine.
Accepts:
| Parameter | Type | Default |
| ------------ | -------- | ------- |
| application | string
| |
| site_key | string
| |
| device_print | object
| |
Returns:
{
"message": "string",
"status": "string",
"data": {
"session_id": "uuid"
}
}
Example:
{
"message": "Evidence Queued",
"status": "success",
"data": {
"session_id": "8a1caf12-cf8c-422f-9394-fae40876442d"
}
}
Usage:
import { GetDevicePrint, SubmitEvidence } from '@boomid/core';
GetDevicePrint()
.then((devicePrint) => {
return SubmitEvidence({
application: 'SDK',
site_key: 'BoomID Site Key',
device_print: devicePrint
})
})
PollResults
Poll the BoomID Identity Assurance Engine for results.
Accepts:
| Parameter | Type | Default |
| --------------- | ------ | ------- |
| intervalMS | int
| 500 |
| endpoint | string | |
| acceptableScore | int
| 90 |
Returns:
{
"status": "string",
"message": "string",
"data": {
"_id": "string",
"session_id": "uuid",
"score": "number",
"recommendation": "string",
"passed": "boolean"
}
}
Example:
{
"status": "success",
"message": "Response received",
"data": {
"_id": "619d37c1a4752e3aabda3808",
"session_id": "8a1caf12-cf8c-422f-9394-fae40876442d",
"score": "84",
"status": "done",
"recomendation": "suspicious"
}
}
Usage:
import { GetDevicePrint, SubmitEvidence, PollResults } from '@boomid/core';
GetDevicePrint()
.then((devicePrint) => {
return SubmitEvidence({
application: 'SDK',
site_key: 'BoomID Site Key',
device_print: devicePrint
})
})
.then((session_id) => {
return PollResults({
intervalMS: 800,
session_id: session_id,
acceptableScore: 75
})
.then((results) => {
// Handle results
if (results.passed) {
// Do something good
} else {
// Handle the fraudulent activity
}
})
})