{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"SDK Reference","product":"Fraud Prevention","type":"markdown"},"seo":{"title":"Migration to v3.x","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":"migration-to-v3x","__idx":0},"children":["Migration to v3.x"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide helps you migrate your React Native Fraud Prevention integration to version 3.x."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Important"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Version 3.x includes breaking changes that will cause runtime errors if not addressed. Review all changes before upgrading. For the full release history, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/TransmitSecurity/react-native-ts-accountprotection/blob/main/RELEASE_NOTES.md"},"children":["Changelog"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"whats-new","__idx":1},"children":["What's new"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Breaking changes"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setUserId()"]}," is renamed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setAuthenticatedUser()"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initializeIOS()"]}," now requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}," as a mandatory parameter."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Android native Fraud Prevention SDK dependency ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.ts.sdk:accountprotection"]}," updated to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3.0.0"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New features"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["claimedUserId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["claimedUserIdType"]}," parameters in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["triggerAction()"]}," for typed user identification (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["claimUserId"]}," is deprecated)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["locationConfig"]}," parameter in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["triggerAction()"]}," for controlling location data collection."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customAttributes"]}," parameter in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["triggerAction()"]}," for sending additional contextual data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["getSessionToken()"]}," for obtaining a device session token for ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/risk/quick_start_backendapi"},"children":["backend integrations"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["logPageLoad()"]}," for tracking screen navigation as part of behavioral data collection."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TSClaimedUserIdType"]}," enum for specifying the type of claimed user ID."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"migrate-your-integration-to-v3x","__idx":2},"children":["Migrate your integration to v3.x"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-update-dependencies","__idx":3},"children":["Step 1: Update dependencies"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Android (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["app/build.gradle"]},"):"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"gradle","header":{"controls":{"copy":{}}},"source":"dependencies {\n  implementation \"com.ts.sdk:accountprotection:2.1.+\"\n}\n","lang":"gradle"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"gradle","header":{"controls":{"copy":{}}},"source":"dependencies {\n  implementation \"com.ts.sdk:accountprotection:3.+\"\n}\n","lang":"gradle"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["npm:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install react-native-ts-accountprotection@^3.0.0\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["iOS:"]}," Navigate to your iOS project directory and run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pod install"]}," to install the React Native module's iOS CocoaPods dependencies."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-rename-setuserid-to-setauthenticateduser","__idx":4},"children":["Step 2: Rename setUserId to setAuthenticatedUser"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setUserId()"]}," function has been renamed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setAuthenticatedUser()"]},". Update all occurrences in your code."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import { setUserId } from 'react-native-ts-accountprotection';\n\nawait setUserId(username);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import { setAuthenticatedUser } from 'react-native-ts-accountprotection';\n\nawait setAuthenticatedUser(username);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3-update-ios-initialization-if-using-explicit-parameters","__idx":5},"children":["Step 3: Update iOS initialization (if using explicit parameters)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you initialize the React Native iOS module with explicit parameters using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initializeIOS()"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}," is now a required parameter. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["baseUrl"]}," value must include the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/risk-collect/"]}," path."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import { initializeIOS } from 'react-native-ts-accountprotection';\n\nawait initializeIOS('YOUR_CLIENT_ID');\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import { initializeIOS } from 'react-native-ts-accountprotection';\n\nawait initializeIOS('YOUR_CLIENT_ID', 'https://api.transmitsecurity.io/risk-collect/');\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you initialize using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initializeSDKIOS()"]}," with a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransmitSecurity.plist"]}," file, no changes are needed for initialization."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-4-update-triggeraction-calls","__idx":6},"children":["Step 4: Update triggerAction calls"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["claimUserId"]}," parameter is deprecated. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["claimedUserId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["claimedUserIdType"]}," instead. The function also accepts two new optional parameters: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["locationConfig"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customAttributes"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const response = await triggerAction(TSAction.login, {\n  correlationId: \"CORRELATION_ID\",\n  claimUserId: \"CLAIMED_USER_ID\",\n  referenceUserId: \"REFERENCE_USER_ID\"\n});\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import { TSClaimedUserIdType } from 'react-native-ts-accountprotection';\n\nconst response = await triggerAction(\n  TSAction.login,\n  {\n    correlationId: \"CORRELATION_ID\",\n    claimedUserId: \"91e25bea0c...\", // hashed email\n    claimedUserIdType: TSClaimedUserIdType.email,\n    referenceUserId: \"REFERENCE_USER_ID\"\n  },\n  { mode: \"default\" },        // locationConfig (optional)\n  { userLevel: \"premium\" }    // customAttributes (optional)\n);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-5-update-import-statements","__idx":7},"children":["Step 5: Update import statements"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Update your imports to reflect the renamed function and new exports:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import { triggerAction, setUserId, clearUser, TSAction } from 'react-native-ts-accountprotection';\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"import { triggerAction, setAuthenticatedUser, clearUser, TSAction, TSClaimedUserIdType } from 'react-native-ts-accountprotection';\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-6-test-your-integration","__idx":8},"children":["Step 6: Test your integration"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify all SDK functionality works as expected."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check for any runtime errors related to renamed methods."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Confirm that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["triggerAction()"]}," returns action tokens as expected with the new parameter structure."]}]}]},"headings":[{"value":"Migration to v3.x","id":"migration-to-v3x","depth":1},{"value":"What's new","id":"whats-new","depth":2},{"value":"Migrate your integration to v3.x","id":"migrate-your-integration-to-v3x","depth":2},{"value":"Step 1: Update dependencies","id":"step-1-update-dependencies","depth":3},{"value":"Step 2: Rename setUserId to setAuthenticatedUser","id":"step-2-rename-setuserid-to-setauthenticateduser","depth":3},{"value":"Step 3: Update iOS initialization (if using explicit parameters)","id":"step-3-update-ios-initialization-if-using-explicit-parameters","depth":3},{"value":"Step 4: Update triggerAction calls","id":"step-4-update-triggeraction-calls","depth":3},{"value":"Step 5: Update import statements","id":"step-5-update-import-statements","depth":3},{"value":"Step 6: Test your integration","id":"step-6-test-your-integration","depth":3}],"frontmatter":{"title":"Migration to v3.x","markdown":{"toc":{"depth":2}},"seo":{"title":"Migration to v3.x"}},"lastModified":"2026-05-25T13:41:40.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/sdk-ref/react-native-ts-accountprotection/migration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}