Skip to main content
Run Link via the Web, iOS, Android, React Native, or Flutter.

Overview

The platform-specific guides below discuss how to initialize Link for first time implementations, or adjust your existing implementation to add new functionalities. For steps on how to update an existing Link implementation to a newer version, visit our Upgrade Guide instead.
For iOS, Android, and React Native implementations, Link SDK’s are maintained and updated through Argyle’s public Github repository. For Flutter implementations, follow the steps in our Flutter initialization guide below.
Link initializations must be configured using the parameters below. There are two required parameters, in addition to a number of optional parameters that are used to add customizations and additional Link features.

Required initialization parameters

ParameterTypeDescription
sandboxbooleanDetermines Link’s environment — true for Sandbox, false for Production.
userTokenstringArgyle utilizes user tokens to identify and authenticate users. See our dedicated User Tokens Guide for more information.

Optional initialization parameters

ParameterTypeDescription
flowIdstringID used to customize the Link flow. Saved IDs can be found in the Flows section of Console.
Flow IDs are not environment-specific. The same Flow ID will apply consistent behavior across both Sandbox and Production.
ddsConfigstringUsed to initialize a deposit switch.
itemsarray of stringsLimits Link search to the provided list of Items. Providing a single Item in the array will skip Link search and take the user directly to that Item’s login screen.
accountIdstringUsed for direct logins to an account that the user has previously connected or attempted to connect.
<Callback Name>stringCallbacks are activated by specific events in Link.
languagestringSpecifies the display language in Link.
  • EN and ES are available across all platforms and employers
  • RU and ZH currently limited to gig platforms
  • Can be used in combination with other optional initialization parameters including flowId
  • Certain platform-generated messages (such as multi-factor authentication prompts) will be shown as-received, and depend on the user’s language preferences selected within their platform’s settings.
Possible values: EN (English), ES (Spanish), RU (Russian), ZH (Chinese).
*Flutter uses lowercase en, es, ru, zh.

Web

Before you start

  1. When using a webview component, make sure localStorage is always enabled, and set domStorageEnabled to true and incognito to false.
  2. If your security policy limits outgoing traffic, allow API calls by whitelisting outgoing traffic from Link by including these two content sources at minimum:
<meta http-equiv="Content-Security-Policy" content="connect-src https://*.argyle.com; worker-src 'self' blob:" />
Create a user token:
  1. Create a new user by sending a POST request to the API’s /users endpoint.
  2. The response payload will include an id and user_token.
  3. Save the id for quickly creating user tokens for this user in the future.
  4. Pass the user_token as the value for the userToken parameter in your Link initialization.
Initialize Link using the HTML below, replacing the user token.
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <!-- This is needed in order to apply proper scaling on mobile devices -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  </head>

  <body>
    <script src="https://plugin.argyle.com/argyle.web.v5.js"></script>
    <script type="text/javascript">
      const linkInstance = Argyle.create({
          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) Add a deposit switch flow:
          //    ddsConfig: '<Encrypted target deposit destination value>',
          // (Optional) Limit Link search to specific Items:
          //    items: ['item_000001422', 'item_000025742'],
          // (Optional) Connect directly to an existing account:
          //    accountId: '<ID of the account>',
          // (Optional) Set a language. Options: EN, ES, RU, ZH
          //    language: 'EN',
          // (Optional) A few recommended callbacks:
          onAccountConnected: payload => console.log('onAccountConnected', payload),
          onAccountError: payload => console.log('onAccountError', payload),
          onDDSSuccess: payload => console.log('onDDSSuccess', payload),
          onDDSError: payload => console.log('onDDSError', payload),
          onTokenExpired: updateToken => {
              console.log('onTokenExpired')
              // Generate a new user token.
              // updateToken(newToken)
          }
      })
      linkInstance.open()
      // linkInstance.close() // Manually close Link (typically the user closes Link).
    </script>
  </body>
</html>

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:
  1. Create a new user by sending a POST request to the API’s /users endpoint.
  2. The response payload will include an id and user_token.
  3. Save the id for quickly creating user tokens for this user in the future.
  4. Pass the user_token as the value for the userToken parameter in your Link initialization.
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) Add a deposit switch flow:
//    config.ddsConfig = "<Encrypted target deposit destination value>"
// (Optional) Limit Link search to specific Items:
//    config.items = ["item_000001422", "item_000025742"]
// (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.onDDSSuccess = { data in
    print("Result: onDDSSuccess \(data)")
}
config.onDDSError = { data in
    print("Result: onDDSError \(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:
  1. Create a new user by sending a POST request to the API’s /users endpoint.
  2. The response payload will include an id and user_token.
  3. Save the id for quickly creating user tokens for this user in the future.
  4. Pass the user_token as the value for the userToken parameter in your Link initialization.
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) Add a deposit switch flow:
//    config.ddsConfig = "<Encrypted target deposit destination value>"
// (Optional) Limit Link search to specific Items:
//    config.items = listOf("item_000001422", "item_000025742")
// (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.onDDSSuccess = { data ->
    Log.d("Result", "onDDSSuccess $data")
}
config.onDDSError = { data ->
    Log.d("Result", "onDDSError $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:
  1. Create a new user by sending a POST request to the API’s /users endpoint.
  2. The response payload will include an id and user_token.
  3. Save the id for quickly creating user tokens for this user in the future.
  4. Pass the user_token as the value for the userToken parameter in your Link initialization.
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) Add a deposit switch flow:
  //    ddsConfig: '<Encrypted target deposit destination value>',
  // (Optional) Limit Link search to specific Items:
  //    items: ['item_000001422', 'item_000025742'],
  // (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),
  onDDSSuccess: (payload) => console.log('onDDSSuccess', payload),
  onDDSError: (payload) => console.log('onDDSError', 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:
  1. Create a new user by sending a POST request to the API’s /users endpoint.
  2. The response payload will include an id and user_token.
  3. Save the id for quickly creating user tokens for this user in the future.
  4. Pass the user_token as the value for the userToken parameter in your Link initialization.
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) Add a deposit switch flow:
  //    ddsConfig: '<Encrypted target deposit destination value>',
  // (Optional) Limit Link search to specific Items:
  //    items: ['item_000001422', 'item_000025742'],
  // (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'),
  onDDSSuccess: (payload) => debugPrint('onDDSSuccess'),
  onDDSError: (payload) => debugPrint('onDDSError'),
  onTokenExpired: (updateToken) => {
    debugPrint('onTokenExpired')
    // Generate a new user token.
    // updateToken(newToken)
  },
);

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