- About the IPQS APIs
- Proxy & VPN Detection API
- Email Verification API
- Phone Number Validation API
- Malicious URL Scanner API
- Device Fingerprint API
- Mobile Device Fingerprinting SDK
- Fraud Flows
- Transaction Scoring API
- Gaming Fraud Detection SDK
- Dark Web Leak API
- Malware File Scanner API
- Request List API
- Fraud Reporting API
- Account Management APIs
- Bulk Validation CSV
- Allowlist Blocklist APIs
- AI Fraud Analyst
- Plugins Platforms Integrations
- IP Reputation Database
- IP Address Abuse Feed
- Email Verification Database
-
Custom Integrations
- Getting Started
- Authentication
- Refresh Secret
- IP & Proxy Checks
- Email Verification Checks
- Phone Number Validity Checks
- Device Tracker
- List Device Trackers
- Device Tracker Statistics
- Login Tokens
- Overview Statistics
- Recent Proxy Statistics
- Recent Email Statistics
- Fraud Reporting
- Retrieve Requests by ID
- Device Fraud Risk Reasons API Documentation
- Transaction Risk Reasons API Documentation
- Country List API Documentation
- Release Notes
React Native SDK
About the React Native Fingerprinting SDK#
The IPQS Mobile Device Fingerprinting SDK protects React Native apps against sophisticated fraud and abuse from high-level bad actors. IPQS uses a mix of JS device fingerprinting and mobile SDK device fingerprinting to enable your React Native app to accurately identify fraud and abusive behavior with mobile device fingerprinting techniques. Verify new or returning users and identify high-risk behavior, including:
- Mobile emulators
- Residential botnets
- Location spoofing
- GPS tampering
- Bots
- Non-human requests
- Fake accounts
- Install fraud
- and hijacked devices.
IPQS makes it easy to detect duplicate accounts, bonus abuse, fraudulent users, fake installs, and more.
Installation#
Note
This SDK is configured for the new architecture with React Native. Ensure that it is enabled for both iOS and Android in your configuration.
-
Download the React Native SDK from the user dashboard after creating a new mobile app and selecting "React Native" as the platform.
-
Add the
fraudengine-1.0.0.tgzfolder to your project. -
Install it locally via
npm.npm install ./path-to-sdkCheck your package.json to confirm it installed correctly.
-
For iOS, open the ios/*YOUR_APP_NAME*/info.plist file.
Add the following to the
element: <key>LSApplicationQueriesSchemes</key> <array> <string>undecimus</string> <string>cydia</string> <string>sileo</string> <string>zbra</string> <string>filza</string> <string>activator</string> </array>For usage of location data, add this to the same info.plist file:
<key>NSLocationWhenInUseUsageDescription</key> <string>Your user-facing reasoning for using location information</string>For usage of App tracking data, add this to the same info.plist file:
<key>NSUserTrackingUsageDescription</key> <string>Your reason for tracking the device</string> -
For Android setup, open or create ./android/local.properties and add:
# note: this will be your app's api key found under app management ipqsApiKey=YOUR_APP_API_KEYAdd the following to your ./android/app/build.gradle
android { /// defaultConfig { /// multiDexEnabled true } } /// dependencies { /// implementation("com.ipqualityscore:fraudengine:1.4.2") /// }Add the following to your ./android/settings.gradle
/// def localProps = new Properties() def localPropsFile = file("local.properties") if (localPropsFile.exists()) { localPropsFile.withInputStream { s -> localProps.load(s) } } def apiKey = localProps.getProperty("ipqsApiKey") dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) repositories { maven { url = uri("https://downloads.ipqualityscore.com/maven2/") credentials { username = "ipqs" password = apiKey } authentication { basic(BasicAuthentication) } } google() mavenCentral() } }For usage of permissions in Android, add the following to your ./android/app/src/main/AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> <uses-permission android:name="android.permission.READ_BASIC_PHONE_STATE"/>
Usage#
Set up and use the FraudEngine class:
///
import FraudEngine from 'fraudengine';
///
export default function App() {
useEffect(() => {
FraudEngine.setApiKey('API_KEY_HERE');
FraudEngine.setAskLocalNetworkPermission(true);
FraudEngine.setAskLocationPermission(true);
FraudEngine.setCaptureAdvertisingID(true);
FraudEngine.setCheckClipboard(true);
}, []);
const mobileTracker = async () => {
try {
const res = await FraudEngine.mobileTracker();
doSomething(res);
} catch (e) {
doSomething(e);
}
};
const verifyEmail = async () => {
try {
const res = await FraudEngine.verifyEmail('INSERT_EMAIL_HERE');
doSomething(res);
} catch (e) {
doSomething(e);
}
};
const verifyPhone = async () => {
try {
const res = await FraudEngine.verifyPhone('INSERT_NUMBER_HERE');
doSomething(res);
} catch (e) {
doSomething(e);
}
};
const verifyIPAddress = async () => {
try {
const res = await FraudEngine.verifyIPAddress('INSERT_IP_HERE');
doSomething(res);
} catch (e) {
doSomething(e);
}
};
}
Add Custom Tracking Variables#
The following code allows for passing custom tracking variables such as a user ID, transaction ID, click ID, and similar identifiers to associate a mobile device fingerprint request with a specific user or action:
// Pass custom variables to pending request
FraudEngine.addCustomVariable("userID", value: "1234");
// then call main mobile fingerprint request which will append the variables above
Set up permissions if needed, false by default#
// For location request
FraudEngine.setAskLocationPermission(true);
// For local network request
FraudEngine.setAskLocalNetworkPermission(true);
// For checking clipboard
FraudEngine.setCheckClipboard(true);
// For capturing advertising ID
FraudEngine.setCaptureAdvertisingID(true);
Mobile Device Fingerprinting#
try {
const res = await FraudEngine.mobileTracker();
doSomething(res);
} catch (e) {
error(e);
}
Email Verification Lookup#
try {
const res = await FraudEngine.verifyEmail('INSERT_EMAIL');
doSomething(res);
} catch (e) {
error(e);
}
IP Address Reputation Lookup#
try {
const res = await FraudEngine.verifyIPAddress('INSERT_IP_ADDRESS_HERE');
doSomething(res);
} catch (e) {
error(e);
}
Phone Number Verification Lookup#
try {
const res = await FraudEngine.verifyPhone('INSERT_NUMBER_HERE');
doSomething(res);
} catch (e) {
error(e);
}
Custom Endpoint#
// Get with support to setup:
FraudEngine.setCustomEndpoint('YOUR_ENDPOINT_HERE');
Retrieve Results#
Note
Before using either of these methods, make sure your initial API request passed a valid userID value (or any variable of your choice) using the addCustomVariable function. The variable name must be set on your custom tracking variables.
Postback Example to Retrieve Latest Request by UserID#
This method uses the Postback API to retrieve requests by userID. Replace XX with the specific user ID you want to retrieve requests for.
https://www.ipqualityscore.com/api/json/postback/XHtctAHRKvJDCu84NmtEltMhwmF0r2Aq?type=mobiletracker&userID=XX
Retrieve multiple requests with the Request List API#
This method uses the Request List API to retrieve requests by userID. Replace XX with the specific user ID you want to retrieve requests for.
https://www.ipqualityscore.com/api/json/requests/XHtctAHRKvJDCu84NmtEltMhwmF0r2Aq/list?type=mobiletracker&userID=XX
Result Methods#
Our SDK offers various result methods and functions to enhance your experience and help prevent fraudulent activity.
| Field | Description | Type |
|---|---|---|
message |
Get the response message string for this request. This usually returns Success but can include administrator-level information on why a request failed. |
String |
success |
A boolean containing the request's success or failure status. Returns true on success, false on failure. |
Boolean |
request_id |
The unique ID associated with this request. Helpful for debugging and postbacks. | String |
fraud_score |
Number 0 - 100 describing how likely this device is to commit fraud. 0 being not at all, 100 being definitively fraudulent. We suggest blocking users greater than 85. | Float |
country_code |
A two-character country code based on this user's IP address. | String |
region |
A string describing the region this user's IP is from. | String |
city |
A string describing the city this user's IP is from. | String |
ISP |
A string describing the ISP this user's IP belongs to. | String |
organization |
A string describing the Organization to which this user's IP belongs. | String |
ASN |
The ASN assigned to the ISP to which this user's IP belongs. | Integer |
latitude |
The latitude where this user's IP is located. | Float |
longitude |
The longitude where this user's IP is located. | Float |
is_crawler |
Returns true if this user's IP is from any of the following search engine crawlers: Baidu, Google, Bing, Yahoo, Yandex, Sogou, Exabot, DuckDuckGo, Facebook, Twitter, Pinterest, Naver, UptimeRobot, AppleBot, ArchiveBot, CoccocBot, YisouBot, PetalBot, ByteDance, and MailRU. |
Boolean |
timezone |
Returns the timezone this user's IP is from. | String |
host |
Returns the hostname of this user's IP address. | String |
proxy |
Returns true if this user's IP is a known proxy. |
Boolean |
vpn |
Returns true if this user's IP is a known VPN. |
Boolean |
tor |
Returns true if this user's IP is a known or suspected TOR node. |
Boolean |
recent_abuse |
Returns true if this user's IP has been reported for being abusive recently or if this device has been seen performing abusive actions. |
Boolean |
bot_status |
Returns true if this user's IP has been reported for botting or if this device has been seen performing bot-like actions. |
Boolean |
connection_type |
Classification of the IP address connection type as Residential, Corporate, Education, Mobile, or Data Center. |
String |
device_suspicious |
Returns true if this device has suspicious properties or has been seen performing suspicious activities recently. |
Boolean |
device_emulated |
Returns true if this device has been emulated or appears to have been emulated. |
Boolean |
device_id |
A unique identifier for this device. | String |
Troubleshooting#
| Error Code | Description | Solution |
|---|---|---|
| REWSC-404 | The API key is missing or invalid. | Confirm you have set up the API key correctly and that the API key is correct. |