Akamai BMP native module requires the following minimum versions for Android and iOS
- Android API 15 (Android 4.0.4) or above
- iOS version 8.0 or above
- React Native 0.41 or above
$ npm install react-native-akamaibmp --save
Mostly automatic installation
$ react-native link react-native-akamaibmp
Update Build Settings: Under the
Build Settings tab, go to
Linking and then under
Other Linker Flags make sure
-ObjC linker option is set.
new RNAkamaibmpPackage(MainApplication.this)in the list returned by the
- In XCode, in the project navigator, right click
Add Files to [your project's name]
- Go to
- In XCode, in the project navigator, select your project. Add
libRNAkamaibmp.ato your project's
Link Binary With Libraries
- Run your project (
- Open up
import com.akamai.react.RNAkamaibmpPackage;to the imports at the top of the file
new RNAkamaibmpPackage(MainApplication.this)to the list returned by the
- Append the following lines to
include ':react-native-akamaibmp' project(':react-native-akamaibmp').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-akamaibmp/android')
- Insert the following lines inside the dependencies block in
The BMP SDK collects behavioral data while the user is interacting with the application. The behavioral data, also known as sensor data, includes the device characteristics, device orientation, accelerometer data, touch events, etc. Akamai BMP SDK provides a simple API to detect bot activities and defend against malicious bot and account takeover.
Import AkamaiBMP module
App.js as shown below:
;const AkamaiBMP = NativeModules;
Collect Sensor Data
The BMP SDK’s sensor data contains serialized user behavioral data and device information.
However, the device information doesn’t contain any information that will identify this device
You can retrieve sensor data from the module by calling the
method. Sensor data should be sent in the REST API request as detailed below.
// Get the BMP sensor dataAkamaiBMP;
Important: Call the getSensorData method only on REST API requests to URLs that will be configured for protection in Bot Manager Premier Mobile. Do not call the getSensorData method for non-protected URLs.
Send Sensor Data
After the sensor data is retrieved from the module, it should be sent in
HTTP header as part your applications REST API (HTTP/S) request. We recommend using
HTTPS for the REST API request to ensure the integrity of sensor data and prevent
eavesdropping. Send the
X-acf-sensor-data header ONLY on HTTP requests to URLs configured for protection in Bot Manager Premier Mobile. Do not send the header and sensor data on every HTTP request the app makes.
Evaluate the Akamai Edge Response
Akamai edge server inspects sensor data and takes the predefined action on the request if the request is classified as BOT, otherwise Akamai sends the request to the origin server.
When the app makes a request, Akamai evaluates the sensor data at the edge. If the request is
classified as human, the traffic continues to the origin server and the response is sent back to
the app. If the request is BOT, there are two possible actions,
- If the action is
monitor, the traffic is allowed and the request is sent to the origin server.
- If the action is
403HTTP response is sent back to the app, and the app should handle the situation and take appropriate action.
Akamai BMP plugin logs some messages at all log levels to verify the SDK initialization. These messages are helpful in identifying any integration issue and ensure the plugin is initialized successfully.
In addition to these messages, the plugin logs additional messages at
error levels, to verify and debug that the SDK is working correctly. The default log level for the plugin is set to log warning and error messages only. This behavior can be changed by calling
To set the log level, call
AkamaiBMP.setLogLevel API with one of the log levels specified
AkamaiBMP.logLevelInfo- Print all messages
AkamaiBMP.logLevelWarn- (Default) Print warning and error messages only
AkamaiBMP.logLevelError- Print error messages only
AkamaiBMP.logLevelNone- Turn off all log messages from the SDK
For example, to see all messages:
// Set the log level to InfoAkamaiBMP;
For further information please refer Akamai BMP SDK Documentation