@mimik/fraudifyr
v2.1.1
Published
Library for determining the likelihood of fraud
Readme
fraudifyr
Example
import fraudifyr from '@mimik/fraudifyr';
const { checkIpFraud, checkEmailFraud } = fraudifyr({ ipqsApiSecretKey: '--secret-key--' });- fraudifyr
- ~fraud(config) ⇒ object
- async
fraudifyr~fraud(config) ⇒ object
Factory that builds the fraud-checking functions bound to an IPQS API secret key.
Kind: inner method of fraudifyr
Returns: object - An object exposing checkIpFraud and checkEmailFraud.
| Param | Type | Description | | --- | --- | --- | | config | object | Configuration for the library. | | config.ipqsApiSecretKey | string | IPQS API secret key, embedded in the request URL path. |
fraudifyr~checkIpFraud(ipAddress, correlationId, metrics) ⇒ Promise
Request to check the likelihood of an IP address being associated with any fraud activity.
Kind: inner method of fraudifyr
Returns: Promise - Resolves with the mapped fraud-checking response.
Category: async
Requires: module:@mimik/response-helper
Fulfil: object - Response of the fraud checking request.
Reject: RichError Rejects with a RichError from @mimik/response-helper.
A successful response would contain properties to determine if the provided ipAddress is fraudulent. The structure is:
{
"fraudScore": 0, // Values can range between `0`-`100`; where `0` means that the system has determined that the likelihood of `ipAddress` being associated with fraudulent activity is zero.
"externalRequestId": "--external-id--" // Request ID in the IPQS system
}| Param | Type | Description | | --- | --- | --- | | ipAddress | string | IP Address to fetch the results for. | | correlationId | string | Correlation ID for the request (to be used for logging). | | metrics | object | To collect metrics of the API request as described in @mimik/request-retry. |
fraudifyr~checkEmailFraud(emailAddress, correlationId, metrics) ⇒ Promise
Request to check the likelihood of an email address being associated with any fraud activity.
Kind: inner method of fraudifyr
Returns: Promise - Resolves with the mapped fraud-checking response.
Category: async
Requires: module:@mimik/response-helper
Fulfil: object - Response of the fraud checking request.
Reject: RichError Rejects with a RichError from @mimik/response-helper.
A successful response would contain properties to determine if the provided emailAddress is fraudulent. The structure is:
{
"fraudScore": 0, // Values can range between `0`-`100`; where `0` means that the system has determined that the likelihood of `emailAddress` being associated with fraudulent activity is zero.
"externalRequestId": "--external-id--" // Request ID in the IPQS system
}| Param | Type | Description | | --- | --- | --- | | emailAddress | string | Email Address to fetch the results for. | | correlationId | string | Correlation ID for the request (to be used for logging). | | metrics | object | To collect metrics of the API request as described in @mimik/request-retry. |
