npm package: @mimik/fraudifyr
Description: Possibility of fraud determining library
Author: mimik technology inc
Latest version: 2.0.0

<a name="module_fraudifyr"></a>

## fraudifyr
**Example**  
```js
import  fraudifyr from '@mimik/fraudifyr');
const { checkIpFraud, checkEmailFraud } = fraudifyr({ ipqsApiSecretKey: '--secret-key--' })
```

* [fraudifyr](#module_fraudifyr)
    * [~checkIpFraud(ipAddress, correlationId, metrics)](#module_fraudifyr..checkIpFraud) ⇒ <code>Promise</code>
    * [~checkEmailFraud(emailAddress, correlationId, metrics)](#module_fraudifyr..checkEmailFraud) ⇒ <code>Promise</code>

<a name="module_fraudifyr..checkIpFraud"></a>

### fraudifyr~checkIpFraud(ipAddress, correlationId, metrics) ⇒ <code>Promise</code>
Request to check the likelihood IP address being associated with any fraud activity.

**Kind**: inner method of [<code>fraudifyr</code>](#module_fraudifyr)  
**Returns**: <code>Promise</code> - Will return the same response as [bluebird](https://www.npmjs.com/package/bluebird).  
**Category**: async  
**Throws**:

- <code>Promise</code> Will throw the same error as [bluebird](https://www.npmjs.com/package/bluebird).

A successful response would contain properties to determine if provided `ipAddress` is fraud. 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
}
````

**Requires**: <code>module:@mimik/response-helper</code>  
**Fulfil**: <code>object</code> - Response of the fraud checking request.  

| Param | Type | Description |
| --- | --- | --- |
| ipAddress | <code>string</code> | IP Address to fetch the results for. |
| correlationId | <code>string</code> | Correlation ID for the request (to be used for logging). |
| metrics | <code>string</code> | To collect metrics of the API request as described in [@mimik/request-retry](https://www.npmjs.com/package/@mimik/request-retry). |

<a name="module_fraudifyr..checkEmailFraud"></a>

### fraudifyr~checkEmailFraud(emailAddress, correlationId, metrics) ⇒ <code>Promise</code>
Request to check the likelihood email address being associated with any fraud activity.

**Kind**: inner method of [<code>fraudifyr</code>](#module_fraudifyr)  
**Returns**: <code>Promise</code> - Will return the same response as [bluebird](https://www.npmjs.com/package/bluebird).  
**Category**: async  
**Throws**:

- <code>Promise</code> Will throw the same error as [bluebird](https://www.npmjs.com/package/bluebird).

A successful response would contain properties to determine if provided `emailAddress` is fraud. 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
}
````

**Requires**: <code>module:@mimik/response-helper</code>  
**Fulfil**: <code>object</code> - Response of the fraud checking request.  

| Param | Type | Description |
| --- | --- | --- |
| emailAddress | <code>string</code> | Email Address to fetch the results for. |
| correlationId | <code>string</code> | Correlation ID for the request (to be used for logging). |
| metrics | <code>string</code> | To collect metrics of the API request as described in [@mimik/request-retry](https://www.npmjs.com/package/@mimik/request-retry). |