{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab"]},"redocly_category":"SDK Reference","product":"Fraud Prevention","type":"markdown"},"seo":{"title":"Overview","description":"Everything about Mosaic Journeys, SDKs, and APIs","siteUrl":"https://developer.transmitsecurity.com/","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"overview","__idx":0},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["react-native-ts-accountprotection"]}," is a React Native module for Mosaic ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/risk/overview"},"children":["Fraud Prevention"]}," on Android and iOS."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/openapi/risk/recommendations.openapi"},"children":["Recommendations"]}," backend API."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"installation","__idx":1},"children":["Installation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the module from npm:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install react-native-ts-accountprotection\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"platform-configuration","__idx":2},"children":["Platform configuration"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Android","disable":false},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"buildgradle","__idx":3},"children":["build.gradle"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["app/build.gradle"]}," file, add the following:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"gradle","header":{"controls":{"copy":{}}},"source":"repositories {\n  google()\n  maven {\n    url 'https://transmit.jfrog.io/artifactory/transmit-security-gradle-release-local/'\n  }\n}\n\ndependencies {\n  implementation \"com.ts.sdk:accountprotection:3.+\"\n}\n","lang":"gradle"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"stringsxml","__idx":4},"children":["strings.xml"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Update your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["strings.xml"]}," file with your credentials:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<resources>\n    <string name=\"transmit_security_client_id\">\"CLIENT_ID\"</string>\n    <string name=\"transmit_security_base_url\">https://api.transmitsecurity.io/risk-collect/</string>\n</resources>\n","lang":"xml"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"iOS","disable":false},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"cocoapods","__idx":5},"children":["CocoaPods"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to your iOS project directory and run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pod install"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"transmitsecurityplist","__idx":6},"children":["TransmitSecurity.plist"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransmitSecurity.plist"]}," file in your native iOS Xcode project:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n    <key>credentials</key>\n    <dict>\n        <key>baseUrl</key>\n        <string>https://api.transmitsecurity.io/risk-collect/</string>\n        <key>clientId</key>\n        <string>[CLIENT_ID]</string>\n    </dict>\n</dict>\n</plist>\n","lang":"xml"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the appropriate base URL for your environment:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Base URL"},"children":["Base URL"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["US"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["EU"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.eu.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Canada"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.ca.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Australia"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.au.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom domain"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://<your_custom_domain>/risk-collect/"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"initialization","__idx":7},"children":["Initialization"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Android","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On Android, the SDK is initialized in the native layer. Open your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MainApplication.kt"]}," file and add:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"import com.transmit.accountprotection.TSAccountProtection\n\nclass MainApplication : Application() {\n  override fun onCreate() {\n    super.onCreate()\n    TSAccountProtection.initializeSDK(this.applicationContext)\n  }\n}\n","lang":"kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"iOS","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On iOS, the SDK can be initialized from the React Native layer or the native layer."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["From React Native (using plist configuration):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import React, { useEffect } from 'react';\nimport { Platform } from 'react-native';\nimport { initializeSDKIOS } from 'react-native-ts-accountprotection';\n\nfunction App() {\n  useEffect(() => {\n    if (Platform.OS === 'ios') {\n      initializeSDKIOS();\n    }\n  }, []);\n\n  // ...\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["From React Native (with explicit parameters):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import React, { useEffect } from 'react';\nimport { Platform } from 'react-native';\nimport { initializeIOS } from 'react-native-ts-accountprotection';\n\nfunction App() {\n  useEffect(() => {\n    if (Platform.OS === 'ios') {\n      initializeIOS(\n        'YOUR_CLIENT_ID', // Required\n        'https://api.transmitsecurity.io/risk-collect/', // Required\n        {\n          enableTrackingBehavioralData: true, // Optional. Defaults to true\n          enableLocationEvents: true // Optional. Defaults to false\n        },\n        'optional-user-id' // Optional: Set user ID during initialization\n      );\n    }\n  }, []);\n\n  // ...\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"initializeios-parameters","__idx":8},"children":["initializeIOS parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your client ID from the Admin Portal"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The base URL for your environment (see table below)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["options"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional configuration object (see below)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Set the user ID during initialization if already known"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the appropriate base URL for your environment:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Base URL"},"children":["Base URL"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["US"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["EU"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.eu.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Canada"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.ca.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Australia"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.au.transmitsecurity.io/risk-collect/"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom domain"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://<your_custom_domain>/risk-collect/"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Options object:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Property"},"children":["Property"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default"},"children":["Default"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enableTrackingBehavioralData"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Enables collection of behavioral data such as user interactions and navigation patterns"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enableLocationEvents"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Enables reporting device location during SDK initialization and when the app moves to the foreground. The user must consent to sharing location in advance (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/risk/report_geolocation"},"children":["Track geolocation"]},")."]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":9},"children":["Next steps"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a complete end-to-end integration walkthrough, see the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/risk/quick_start_react_native"},"children":["React Native module quick start"]},"."]}]},"headings":[{"value":"Overview","id":"overview","depth":1},{"value":"Installation","id":"installation","depth":2},{"value":"Platform configuration","id":"platform-configuration","depth":2},{"value":"build.gradle","id":"buildgradle","depth":3},{"value":"strings.xml","id":"stringsxml","depth":3},{"value":"CocoaPods","id":"cocoapods","depth":3},{"value":"TransmitSecurity.plist","id":"transmitsecurityplist","depth":3},{"value":"Initialization","id":"initialization","depth":2},{"value":"initializeIOS parameters","id":"initializeios-parameters","depth":3},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Fraud Prevention overview","markdown":{"toc":{"depth":2}},"seo":{"title":"Overview"}},"lastModified":"2026-06-17T11:04:38.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/sdk-ref/react-native-ts-accountprotection/drs_overview","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}