Skip to content

The react-native-ts-accountprotection is a React Native module for Mosaic Fraud Prevention on Android and iOS.

When initialized, the module automatically starts collecting and submitting telemetry data to Mosaic—including information about the user journey, device data, and user interactions. Once specific user actions are performed on the client side (such as login), Fraud Prevention should be called to track those action events and obtain action tokens. The data collected can then be queried for recommendations using the Recommendations backend API.

Installation

Install the module from npm:

npm install react-native-ts-accountprotection

Platform configuration

build.gradle

In your app/build.gradle file, add the following:

repositories {
  google()
  maven {
    url 'https://transmit.jfrog.io/artifactory/transmit-security-gradle-release-local/'
  }
}

dependencies {
  implementation "com.ts.sdk:accountprotection:3.+"
}

strings.xml

Update your strings.xml file with your credentials:

<resources>
    <string name="transmit_security_client_id">"CLIENT_ID"</string>
    <string name="transmit_security_base_url">https://api.transmitsecurity.io/risk-collect/</string>
</resources>

Use the appropriate base URL for your environment:

EnvironmentBase URL
UShttps://api.transmitsecurity.io/risk-collect/
EUhttps://api.eu.transmitsecurity.io/risk-collect/
Canadahttps://api.ca.transmitsecurity.io/risk-collect/
Australiahttps://api.au.transmitsecurity.io/risk-collect/
Custom domainhttps://<your_custom_domain>/risk-collect/

Initialization

On Android, the SDK is initialized in the native layer. Open your MainApplication.kt file and add:

import com.transmit.accountprotection.TSAccountProtection

class MainApplication : Application() {
  override fun onCreate() {
    super.onCreate()
    TSAccountProtection.initializeSDK(this.applicationContext)
  }
}

Next steps

For a complete end-to-end integration walkthrough, see the React Native module quick start.