{"templateId":"markdown","sharedDataIds":{},"props":{"metadata":{"markdoc":{"tagList":["InteractiveLink","Notification","LightboxImage","CodeBlockCustom","CodeItem"]},"type":"markdown"},"seo":{"title":"React native quickstart","siteUrl":"https://developers.frontegg.com/","llmstxt":{"title":"Frontegg Developer Documentation","description":"Authentication, authorization, and user management for Customer Identity, plus Agen for SaaS and Agen for Work. Guides, SDKs, and API references.","sections":[{"title":"Customer Identity (CIAM)","description":"Auth, SSO, SCIM, entitlements, and user management — guides, SDKs, and APIs.","includeFiles":["ciam/**/*.md"],"excludeFiles":[]},{"title":"Agen for SaaS","description":"Agentic access and authorization for SaaS products.","includeFiles":["agen-for-saas/**/*.md"],"excludeFiles":[]},{"title":"Agen for Work","description":"Agentic access and authorization for internal and workforce use.","includeFiles":["agen-for-work/**/*.md"],"excludeFiles":[]},{"title":"Platform","description":"Shared platform overview.","includeFiles":["platform/**/*.md"],"excludeFiles":[]}],"excludeFiles":["internal-docs/**","ciam/guides/env-settings/inject-client-ip.md","CLAUDE.md",".claude/**","**/images/**"],"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"react-native-quickstart","__idx":0},"children":["React native quickstart"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide is a walkthrough on how to integrate Frontegg’s authentication magic into your app using the Frontegg React Native SDK. Whether you need to add secure sign-ups, logins, multi-factor authentication, or even social logins, this guide has you covered with simple, step-by-step instructions to get things rolling in no time."]},{"$$mdtype":"Tag","name":"InteractiveLink","attributes":{"href":"https://github.com/frontegg/frontegg-react-native","target":"_blank","justifyContent":"center"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check out the sample package on GitHub"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Notification","attributes":{"title":"Prerequisites","type":"attention"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Frontegg Hosted Login is required, and setting a ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/ciam/guides/env-settings/custom-domain"},"children":["custom domain"]}," is highly recommended.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"iOS ≥ 14",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Android ≥ 26"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"prepare-your-frontegg-workspace","__idx":1},"children":["Prepare your Frontegg workspace"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.frontegg.com/development/settings"},"children":["Frontegg Portal Settings"]},", If you don't have application",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"follow the integration steps after signing up. Copy ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggDomain"]}," to future steps from ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.frontegg.com/development/settings/domains"},"children":["Frontegg Portal Domain"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"LightboxImage","attributes":{"isLightbox":true},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/new-frontegg-domain.60f517108b4c93feb0326bd54894cfac97dcc0d10d29d12eb2cf4ef068816e5f.14341b2b.png","alt":"frontegg-domain"},"children":[]}]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://portal.frontegg.com/development/authentication/hosted"},"children":["Login Method Settings"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Toggle on Hosted login method for iOS:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{IOS_BUNDLE_IDENTIFIER}}://{{FRONTEGG_BASE_URL}}/ios/oauth/callback"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Toggle Hosted login method for Android:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{{ANDROID_PACKAGE_NAME}}://{{FRONTEGG_BASE_URL}}/android/oauth/callback"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://{{FRONTEGG_BASE_URL}}/oauth/account/redirect/android/{{ANDROID_PACKAGE_NAME}}"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IOS_BUNDLE_IDENTIFIER"]}," with your application identifier"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FRONTEGG_BASE_URL"]}," with your Frontegg base url, without ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["https"]},", i.e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggDomain"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ANDROID_PACKAGE_NAME"]}," with your android package name"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add frontegg package to the project:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["npm","yarn"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"npm install -s @frontegg/react-native\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"yarn add @frontegg/react-native\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"setup-ios-project","__idx":2},"children":["Setup iOS project"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create Frontegg plist file"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To setup your SwiftUI application to communicate with Frontegg, you have to create a new file named ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Frontegg.plist"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"under your root project directory, this file will store values to be used variables by Frontegg SDK:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"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>baseUrl</key>\n        <string>https://[DOMAIN_HOST_FROM_PREVIOUS_STEP]</string>\n        <key>clientId</key>\n        <string>[CLIENT_ID_FROM_PREVIOUS_STEP]</string>\n    </dict>\n</plist>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"multi-apps-ios-support","__idx":3},"children":["Multi-apps iOS support"]},{"$$mdtype":"Tag","name":"Notification","attributes":{"title":"Prerequisites","type":"attention"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The use of this feature requires minimum @frontegg/react-native@1.2.4"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide outlines the steps to configure your iOS application to support multiple applications."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Modify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Frontegg.plist"]}," file and add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["applicationId"]},":"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"plist version=\"1.0\">\n  <dict>\n    <key>applicationId</key>\n    <string>your-application-id-uuid</string>\n    <key>baseUrl</key>\n    <string>https://your-domain.fronteg.com</string>\n    <key>clientId</key>\n    <string>your-client-id-uuid</string>\n  </dict>\n</plist>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-ios-associated-domain","__idx":4},"children":["Configure iOS associated domain"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configuring your iOS associated domain is required for Magic Link authentication / Reset Password / Activate Account."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to add your iOS associated domain to your Frontegg application, you will need to update in each of your",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"integrated Frontegg Environments the iOS associated domain that you would like to use with that Environment. Send a POST request to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.frontegg.com/vendors/resources/associated-domains/v1/ios"]}," with the following payload:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n    “appId”:[YOUR_ASSOCIATED_DOMAIN]\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to use our API’s, follow [this guide] to generate a vendor token."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"setup-android-project","__idx":5},"children":["Setup Android project"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set minimum sdk version:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To set up your Android minimum sdk version, open root gradle file at",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android/build.gradle"]},",",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"and add/edit the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["minSdkVersion"]}," under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["buildscript.ext"]},":"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["groovy"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"buildscript {\n    ext {\n        minSdkVersion = 26\n        // ...\n    }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Configure build config fields:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To set up your Android application on to communicate with Frontegg, you have to add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["buildConfigField"]}," property the",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"gradle ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android/app/build.gradle"]},". This property will store frontegg hostname (without https) and client id from previous step:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["groovy"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"def fronteggDomain = \"FRONTEGG_DOMAIN_HOST.com\" // without protocol https://\ndef fronteggClientId = \"FRONTEGG_CLIENT_ID\"\n\nandroid {\n    defaultConfig {\n\n        manifestPlaceholders = [\n                \"package_name\" : applicationId,\n                \"frontegg_domain\" : fronteggDomain,\n                \"frontegg_client_id\": fronteggClientId\n        ]\n\n        buildConfigField \"String\", 'FRONTEGG_DOMAIN', \"\\\"$fronteggDomain\\\"\"\n        buildConfigField \"String\", 'FRONTEGG_CLIENT_ID', \"\\\"$fronteggClientId\\\"\"\n        buildConfigField \"Boolean\", 'FRONTEGG_USE_ASSETS_LINKS', \"true\" /** For using frontegg domain for deeplinks **/\n        buildConfigField \"Boolean\", 'FRONTEGG_USE_CHROME_CUSTOM_TABS', \"true\"  /** For using custom chrome tab for social-logins **/\n    }\n\n\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bundleConfig=true"]}," if not exists inside the android section inside the app gradle ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android/app/build.gradle"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["groovy"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"android {\n  buildFeatures {\n    buildConfig = true\n  }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add permissions to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AndroidManifest.xml"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INTERNET"]}," permission to the app's manifest file."]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<uses-permission android:name=\"android.permission.INTERNET\"/>\n<uses-permission android:name=\"android.permission.POST_NOTIFICATIONS\"/>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Config Android ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configuring your Android ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}," is required for Magic Link authentication / Reset Password / Activate Account /",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"login with IdPs."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To add your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}," to your Frontegg application, you will need to update in each of your integrated Frontegg",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Environments the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AssetLinks"]}," that you would like to use with that Environment. Send a POST request to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.frontegg.com/vendors/resources/associated-domains/v1/android"]}," with the following payload:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["xml"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n    \"packageName\": \"YOUR_APPLICATION_PACKAGE_NAME\",\n    \"sha256CertFingerprints\": [\"YOUR_KEYSTORE_CERT_FINGERPRINTS\"]\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each Android app has multiple certificate fingerprint, to get your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DEBUG"]}," sha256CertFingerprint you have to run the",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"below command. For Debug mode, run the following command and copy the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SHA-256"]}," value:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NOTE:"]}," make sure to choose the Variant and Config equals to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debug"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["bash"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"./gradlew signingReport\n\n###################\n#  Example Output:\n###################\n\n#  Variant: debug\n#  Config: debug\n#  Store: /Users/davidfrontegg/.android/debug.keystore\n#  Alias: AndroidDebugKey\n#  MD5: 25:F5:99:23:FC:12:CA:10:8C:43:F4:02:7D:AD:DC:B6\n#  SHA1: FC:3C:88:D6:BF:4E:62:2E:F0:24:1D:DB:D7:15:36:D6:3E:14:84:50\n#  SHA-256: D9:6B:4A:FD:62:45:81:65:98:4D:5C:8C:A0:68:7B:7B:A5:31:BD:2B:9B:48:D9:CF:20:AE:56:FD:90:C1:C5:EE\n#  Valid until: Tuesday, 18 June 2052\n\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For Release mode, Extract the SHA256 using keytool from your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Release"]}," keystore file:"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["bash"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"keytool -list -v -keystore /PATH/file.jks -alias YourAlias -storepass *** -keypass ***\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"enabling-chrome-custom-tabs-for-social-login","__idx":6},"children":["Enabling chrome custom tabs for social login"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To enable social login using Chrome Custom Tabs within your Android application, you need to modify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["android/app/build.gradle"]}," file. Add a boolean ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["buildConfigField"]}," for the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FRONTEGG_USE_CHROME_CUSTOM_TABS"]}," flag and set it to true."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By default, the SDK defaults to using the Chrome browser for social login."]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["groovy"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"def fronteggDomain = \"FRONTEGG_DOMAIN_HOST.com\" // without protocol https://\ndef fronteggClientId = \"FRONTEGG_CLIENT_ID\"\n\nandroid {\n   defaultConfig {\n\n       manifestPlaceholders = [\n               \"package_name\" : applicationId,\n               \"frontegg_domain\" : fronteggDomain,\n               \"frontegg_client_id\": fronteggClientId\n       ]\n\n       buildConfigField \"String\", 'FRONTEGG_DOMAIN', \"\\\"$fronteggDomain\\\"\"\n       buildConfigField \"String\", 'FRONTEGG_CLIENT_ID', \"\\\"$fronteggClientId\\\"\"\n\n       buildConfigField \"Boolean\", 'FRONTEGG_USE_CHROME_CUSTOM_TABS', \"true\"\n   }\n\n\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"multi-apps-android-support","__idx":7},"children":["Multi-apps Android support"]},{"$$mdtype":"Tag","name":"Notification","attributes":{"title":"Prerequisites","type":"attention"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The use of this feature requires minimum @frontegg/react-native@1.2.4"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide outlines the steps to configure your Android application to support multiple applications."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FRONTEGG_APPLICATION_ID"]}," buildConfigField into the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["build.gradle"]}," file:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["groovy"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"def fronteggApplicationId = \"your-application-id-uuid\"\n...\nandroid {\n    ...\n    buildConfigField \"String\", 'FRONTEGG_APPLICATION_ID', \"\\\"$fronteggApplicationId\\\"\"\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"handle-open-app-with-url","__idx":8},"children":["Handle open app with URL"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To handle Login with magic link and other authentication methods that require to open the app with a URL, you have to",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"add the following code to."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"for-objective-c","__idx":9},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["For Objective-C:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggSwiftAdapter.swift"]}," in your project and add the following code:"]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["objective-c"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"//  FronteggSwiftAdapter.swift\n\n   import Foundation\n   import FronteggSwift\n\n   @objc(FronteggSwiftAdapter)\n   public class FronteggSwiftAdapter: NSObject {\n       @objc public static let shared = FronteggSwiftAdapter()\n\n       @objc public func handleOpenUrl(_ url: URL) -> Bool {\n           return FronteggAuth.shared.handleOpenUrl(url)\n       }\n   }\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AppDelegate.m"]}," file and import swift headers:"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["objective-c"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"#import <[YOUR_PROJECT_NAME]-Swift.h>\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add URL handlers to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AppDelegate.m"]},":"," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]}]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["objective-c"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"#import <[YOUR_PROJECT_NAME]-Swift.h>\n\n   // ...CODE...\n\n   - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url\n           options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options\n   {\n\n     if([[FronteggSwiftAdapter shared] handleOpenUrl:url] ){\n       return TRUE;\n     }\n     return [RCTLinkingManager application:app openURL:url options:options];\n   }\n\n   - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity\n    restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler\n   {\n\n     if (userActivity.webpageURL != NULL){\n       if([[FronteggSwiftAdapter shared] handleOpenUrl:userActivity.webpageURL] ){\n         return TRUE;\n       }\n     }\n    return [RCTLinkingManager application:application\n                     continueUserActivity:userActivity\n                       restorationHandler:restorationHandler];\n   }\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"for-swift","__idx":10},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["For Swift:"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AppDelegate.m"]}," file and import swift headers:"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["swift"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import FronteggSwift\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add URL handlers to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AppDelegate.swift"]},":"]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["swift"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import UIKit\n   import FronteggSwift\n\n   @UIApplicationMain\n   class AppDelegate: UIResponder, UIApplicationDelegate {\n\n       /*\n        * Called when the app was launched with a url. Feel free to add additional processing here,\n        * but if you want the App API to support tracking app url opens, make sure to keep this call\n        */\n       func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {\n\n           if(FronteggAuth.shared.handleOpenUrl(url)){\n               return true\n           }\n\n           return ApplicationDelegateProxy.shared.application(app, open: url, options: options)\n       }\n\n       /*\n        * Called when the app was launched with an activity, including Universal Links.\n        * Feel free to add additional processing here, but if you want the App API to support\n        * tracking app url opens, make sure to keep this call\n        */\n       func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {\n\n           if let url = userActivity.webpageURL {\n               if(FronteggAuth.shared.handleOpenUrl(url)){\n                   return true\n               }\n           }\n           return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)\n       }\n   }\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"wrap-your-app-with-fronteggprovider","__idx":11},"children":["Wrap your app with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggProvider"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NOTE:"]}," we recommend to use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FronteggWrapper"]}," component along with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NavigationContainer"]}," from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@react-navigation/native"]},". To install ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@react-navigation/native"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@react-navigation/native-stack"]}," run the following command:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":["npm","yarn"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"npm install -s @react-navigation/native @react-navigation/native-stack react-native-screens react-native-safe-area-context\n"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"yarn add @react-navigation/native @react-navigation/native-stack react-native-screens react-native-safe-area-context\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Modify your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["App.tsx"]}," file and wrap your app with FronteggProvider and pass your Frontegg configuration:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":[".tsx"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import * as React from 'react';\nimport { NavigationContainer } from '@react-navigation/native';\nimport { createNativeStackNavigator } from '@react-navigation/native-stack';\nimport HomeScreen from './HomeScreen';\nimport ProfileScreen from './ProfileScreen';\nimport { FronteggWrapper } from '@frontegg/react-native';\n\nconst Stack = createNativeStackNavigator();\n\nexport default () => {\n  return (\n    <FronteggWrapper>\n      <NavigationContainer>\n        <Stack.Navigator>\n          <Stack.Screen name=\"Home\" component={HomeScreen} />\n          <Stack.Screen name=\"Profile\" component={ProfileScreen} />\n        </Stack.Navigator>\n      </NavigationContainer>\n    </FronteggWrapper>\n  );\n};\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"login-with-frontegg","__idx":12},"children":["Login with Frontegg"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To login with Frontegg you can use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useAuth"]}," hook:"]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":[".tsx"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import { View, Button } from 'react-native';\nimport { useAuth } from '@frontegg/react-native';\n\n\nexport function MyScreen() {\n  const { isAuthenticated, login, logout } = useAuth();\n\n  return <View>\n    <Button title={'Login'} onPress={login} />\n  </View>\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"switch-users-tenant","__idx":13},"children":["Switch user's tenant"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To switch tenant, get ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["switchTenant"]}," from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useAuth"]}," hook:"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":[".tsx"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import { useCallback } from 'react';\nimport { View, Button } from 'react-native';\nimport { useAuth } from '@frontegg/react-native';\n\n\nexport function MyScreen() {\n  const { switchTenant, user } = useAuth();\n\n  // user avaiable tenants from user.tenants\n  console.log(\"user tenants\", user?.tenants)\n\n  const handleSwitchTenant = useCallback(() => {\n    const tenantId = 'TENANT_ID'; // get tenant id from your app state\n\n\n    switchTenant(tenantId).then(() => {\n      console.log('Tenant switched successfully');\n    }).catch((error) => {\n      console.log('Failed to switch tenant', error);\n    });\n  }, [ switchTenant ]);\n\n  return <View>\n    <Button title={'Switch Tenant'} onPress={handleSwitchTenant} />\n  </View>;\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"check-whether-user-is-authenticated","__idx":14},"children":["Check whether user is authenticated"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To check whether the user is authenticated before displaying your app, you can use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useAuth"]}," hook along with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isLoading"]}," property:"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"CodeBlockCustom","attributes":{"tabs":[".tsx"]},"children":[{"$$mdtype":"Tag","name":"CodeItem","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"import { StyleSheet, View, Text, Button } from 'react-native';\nimport { useAuth } from '@frontegg/react-native';\n\nexport default function HomeScreen() {\n  const {\n    showLoader,\n    isLoading,\n    isAuthenticated,\n    user,\n  } = useAuth();\n\n  // showLoader when the SDK is initializing the app / authenticate the user\n  if (showLoader || isLoading) {\n    return <View>\n      <Text>Loading...</Text>\n    </View>\n  }\n\n\n  return <View>\n    <Text>{isAuthenticated ? 'Authenticated' : 'Not authenticated'}</Text>\n\n    {isAuthenticated && <Text>{user?.email}</Text>}\n\n    <Button\n      color={isAuthenticated ? '#FF0000' : '#000000'}\n      title={isAuthenticated ? 'Logout' : 'Login'}\n      onPress={() => {\n        isAuthenticated ? logout() : login();\n      }}\n    />\n  </View>\n}\n"},"children":[]}]}]}]},"headings":[{"value":"React native quickstart","id":"react-native-quickstart","depth":2},{"value":"Prepare your Frontegg workspace","id":"prepare-your-frontegg-workspace","depth":3},{"value":"Setup iOS project","id":"setup-ios-project","depth":3},{"value":"Multi-apps iOS support","id":"multi-apps-ios-support","depth":3},{"value":"Configure iOS associated domain","id":"configure-ios-associated-domain","depth":3},{"value":"Setup Android project","id":"setup-android-project","depth":3},{"value":"Enabling chrome custom tabs for social login","id":"enabling-chrome-custom-tabs-for-social-login","depth":3},{"value":"Multi-apps Android support","id":"multi-apps-android-support","depth":3},{"value":"Handle open app with URL","id":"handle-open-app-with-url","depth":3},{"value":"For Objective-C:","id":"for-objective-c","depth":4},{"value":"For Swift:","id":"for-swift","depth":4},{"value":"Wrap your app with FronteggProvider","id":"wrap-your-app-with-fronteggprovider","depth":3},{"value":"Login with Frontegg","id":"login-with-frontegg","depth":3},{"value":"Switch user's tenant","id":"switch-users-tenant","depth":3},{"value":"Check whether user is authenticated","id":"check-whether-user-is-authenticated","depth":3}],"frontmatter":{"seo":{"title":"React native quickstart"}},"lastModified":"2025-11-04T13:25:50.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ciam/sdks/mobile/react-native/login-old","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}