Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.argyle.com/llms.txt

Use this file to discover all available pages before exploring further.

Use a mobile SDK when Link should run inside your native or cross-platform mobile application. Argyle supports iOS, Android, React Native, and Flutter.
If you are not using a mobile SDK, prefer either a client-hosted Web SDK implementation in a secure webview, or Hosted Link in a secure browser context such as ASWebAuthenticationSession or Android Custom Tabs.
User tokens and session links both expire after one hour. Create a fresh user token before initializing Link with userToken, or create a new session link for an active verification before initializing Link with connectUrl.

iOS

Argyle’s iOS Link SDK provides a way to integrate Link into your iOS app. First-time installation instructions are below. To update versions, visit our iOS Link upgrade guide.

Requirements - iOS SDK

iOS 14.0+, Xcode 14.0+, Swift 5.5+

Installing the iOS SDK

If using CocoaPods:
  1. In the Podfile of your Xcode project, add pod 'Argyle', '<Version Number>'
  2. Run pod install to install the Argyle pod
  3. Run pod update to ensure the most recent Argyle pod is installed

Directly opening email clients

To enhance the multi-factor authentication (MFA) experience of users, the iOS Link SDK supports directly opening the user’s email client. To enable this feature, add the following property to your Info.plist file:
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>googlegmail</string>
    <string>ymail</string>
    <string>ms-outlook</string>
</array>
Create a user token:
  • New users: create the user via POST /v2/users and use the returned user_token.
  • Returning users: create a new token via POST /v2/user-tokens and use the returned user_token.
Initialize Link using the configuration below, replacing the user token.
var config = LinkConfig(
    userToken: "USER_TOKEN",
    sandbox: true // Set to false for production environment.
)
// (Optional) Add a Link flow customization created in Console:
//    config.flowId = "<ID of the Link flow>"
// (Optional) Limit Link search to specific Items:
//    config.items = ["item_000000001", "item_000000002"]
// (Optional) Connect directly to an existing account:
//    config.accountId = "<ID of the account>"
// (Optional) Set a language. Options: EN, ES, RU, ZH
//    config.language = .EN
// (Optional) A few recommended callbacks:
config.onAccountConnected = { data in
    print("Result: onAccountConnected \(data)")
}
config.onAccountError = { data in
    print("Result: onAccountError \(data)")
}
config.onTokenExpired = { handler in
    print("onTokenExpired")
    // Generate a new user token.
    // handler(newToken)
}

ArgyleLink.start(from: viewController, config: config)
// ArgyleLink.close()   // Manually close Link (typically the user closes Link).

Android

Argyle’s Android Link SDK provides a way to integrate Link into your Android app. First-time installation instructions are below. To update versions, visit our Android Link upgrade guide.

Requirements - Android SDK

  • Android 8.0 (minSdk/API level 26) and above
  • compileSdk 34 and above

Installing the Android SDK

  1. Add the line below within the dependencies of your build.gradle configuration file.
  2. Sync your Android project to import the build configuration changes.
dependencies {
    implementation 'com.argyle:argyle-link-android:5.x.x'
}
Make sure to exclude the Link SDK package com.argyle.*. For example, add the following line to the proguard-rules.pro file of your ProGuard configuration:
-keep class com.argyle. { *; }
Create a user token:
  • New users: create the user via POST /v2/users and use the returned user_token.
  • Returning users: create a new token via POST /v2/user-tokens and use the returned user_token.
Initialize Link using the configuration below, replacing the user token.
val config = LinkConfig(
    userToken = "USER_TOKEN",
    sandbox = true // Set to false for production environment.
)
// (Optional) Add a Link flow customization created in Console:
//    config.flowId = "<ID of the Link flow>"
// (Optional) Limit Link search to specific Items:
//    config.items = listOf("item_000000001", "item_000000002")
// (Optional) Connect directly to an existing account:
//    config.accountId = "<ID of the account>"
// (Optional) Set a language. Options: EN, ES, RU, ZH
//    config.language = Language.EN
// (Optional) A few recommended callbacks:
config.onAccountConnected = { data ->
    Log.d("Result", "onAccountConnected $data")
}
config.onAccountError = { data ->
    Log.d("Result", "onAccountError $data")
}
config.onTokenExpired = { handler ->
    // Generate a new user token.
    // handler(newToken)
}

ArgyleLink.start(context, config)
// ArgyleLink.close()   // Manually close Link (typically the user closes Link).

React Native

Argyle’s React Native Link SDK provides a way to integrate Link into your React Native application. First-time installation instructions are below. To update versions, visit our React Native Link upgrade guide.

Requirements - React Native SDK

  • React Native version 0.73.0 or higher
  • iOS-specific: iOS 14.0+
  • Android-specific:
    • Android 8.0 (minSdk/API level 26) and above
    • compileSdk 34 and above
Make sure to exclude the Link SDK package com.argyle.*. For example, add the following line to the bottom of your ProGuard configuration:
-keep class com.argyle. { *; }

Installing the React Native SDK

  1. Navigate to the directory for your React Native project.
  2. Install the packages from your terminal:
npm install @argyleio/argyle-plugin-react-native --save
After installation:
  1. Run cd ios to navigate to the ios folder.
  2. Run pod install to install the Argyle pod.
  3. Run pod update to ensure the most recent Argyle pod is installed.
Create a user token:
  • New users: create the user via POST /v2/users and use the returned user_token.
  • Returning users: create a new token via POST /v2/user-tokens and use the returned user_token.
Initialize Link using the configuration below, replacing the user token.
import { ArgyleLink } from '@argyleio/argyle-plugin-react-native';

// ...

const config = {
  userToken: 'USER_TOKEN',
  sandbox: true, // Set to false for production environment.
  // (Optional) Add a Link flow customization created in Console:
  //    flowId: '<ID of the Link flow>',
  // (Optional) Limit Link search to specific Items:
  //    items: ['item_000000001', 'item_000000002'],
  // (Optional) Connect directly to an existing account:
  //    accountId: '<ID of the account>',
  // (Optional) Set a language. Options: EN, ES, RU, ZH
  //    language: Language.EN,
  // (Optional) Callback examples:
  onAccountConnected: (payload) => console.log('onAccountConnected', payload),
  onAccountError: (payload) => console.log('onAccountError', payload),
  onTokenExpired: (updateToken) => {
    console.log('onTokenExpired');
    // Generate a new user token.
    // updateToken(newToken)
  },
};

ArgyleLink.start(config);
// ArgyleLink.close()   // Manually close Link (typically the user closes Link).

Flutter

Argyle’s Flutter SDK provides a way to integrate Link into your mobile applications. First-time installation instructions are below. To update versions, visit our Flutter upgrade guide.

Requirements - Flutter SDK

  • Android 8.0 (minSdk/API level 26) and above
  • compileSdk 34 and above
Set the minSdkVersion in your android/app/build.gradle file to:
android {
    defaultConfig {
        minSdkVersion 26 // or greater
    }
}

Installing the Flutter SDK

Add argyle_link_flutter as a dependency in your pubspec.yaml file.
Using Flutter, run the command:
$ flutter pub add argyle_link_flutter
This will add a line to your pubspec.yaml file with the latest SDK version:
dependencies:
  argyle_link_flutter: ^1.x.x
You can now import the package into your Dart code using:
import 'package:argyle_link_flutter/argyle_link_flutter.dart';
Create a user token:
  • New users: create the user via POST /v2/users and use the returned user_token.
  • Returning users: create a new token via POST /v2/user-tokens and use the returned user_token.
Initialize Link using the configuration below, replacing the user token.
import 'package:argyle_link_flutter/link_config.dart';
// (Required if using callbacks) Callback argument type definitions:
import 'package:argyle_link_flutter/account_data.dart';
import 'package:argyle_link_flutter/argyle_link.dart';
import 'package:argyle_link_flutter/form_data.dart';

// ...

final config = LinkConfig(
  userToken: 'USER_TOKEN',
  sandbox: true, // Set to false for production environment.
  // (Optional) Add a Link flow customization created in Console:
  //    flowId: '<ID of the Link flow>',
  // (Optional) Limit Link search to specific Items:
  //    items: ['item_000000001', 'item_000000002'],
  // (Optional) Connect directly to an existing account:
  //    accountId: '<ID of the account>',
  // (Optional) Set a language. Options: en, es, ru, zh
  //    language: Language.en,
  // (Optional) Callback examples:
  onAccountConnected: (payload) => debugPrint('onAccountConnected'),
  onAccountError: (payload) => debugPrint('onAccountError'),
  onTokenExpired: (updateToken) {
    debugPrint('onTokenExpired');
    // Generate a new user token.
    // updateToken(newToken);
  },
);

ArgyleLink.start(config);
// ArgyleLink.close()   // Manually close Link (typically the user closes Link).