Initialization

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
sandboxboolean   Determines Link's environment — true for Sandbox, false for Production.
userToken   stringArgyle 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.
Formerly named customizationId (deprecated) in Link 4.
IDs of previously created customizations can be used with the flowId parameter.
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.

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:
1<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.

1<!DOCTYPE html>
2<html>
3  <head>
4    <meta charset="utf-8" />
5    <!-- This is needed in order to apply proper scaling on mobile devices -->
6    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7  </head>
8
9  <body>
10    <script src="https://plugin.argyle.com/argyle.web.v5.js"></script>
11    <script type="text/javascript">
12      const linkInstance = Argyle.create({
13          userToken: 'USER_TOKEN',
14          sandbox: true, // Set to false for production environment.
15          // (Optional) Add a Link flow customization created in Console:
16          //    flowId: '<ID of the Link flow>',
17          // (Optional) Add a deposit switch flow:
18          //    ddsConfig: '<Encrypted target deposit destination value>',
19          // (Optional) Limit Link search to specific Items:
20          //    items: ['item_000001422', 'item_000025742'],
21          // (Optional) Connect directly to an existing account:
22          //    accountId: '<ID of the account>',
23          // (Optional) A few recommended callbacks:
24          onAccountConnected: payload => console.log('onAccountConnected', payload),
25          onAccountError: payload => console.log('onAccountError', payload),
26          onDDSSuccess: payload => console.log('onDDSSuccess', payload),
27          onDDSError: payload => console.log('onDDSError', payload),
28          onTokenExpired: updateToken => {
29              console.log('onTokenExpired')
30              // Generate a new user token.
31              // updateToken(newToken)
32          }
33      })
34      linkInstance.open()
35      // linkInstance.close() // Manually close Link (typically the user closes Link).
36    </script>
37  </body>
38</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:

1<key>LSApplicationQueriesSchemes</key>
2<array>
3    <string>googlegmail</string>
4    <string>ymail</string>
5    <string>ms-outlook</string>
6</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.

1var config = LinkConfig(
2    userToken: "USER_TOKEN",
3    sandbox: true // Set to false for production environment.
4)
5// (Optional) Add a Link flow customization created in Console:
6//    config.flowId = "<ID of the Link flow>"
7// (Optional) Add a deposit switch flow:
8//    config.ddsConfig = "<Encrypted target deposit destination value>"
9// (Optional) Limit Link search to specific Items:
10//    config.items = ["item_000001422", "item_000025742"]
11// (optional) Connect directly to an existing account:
12//    config.accountId = "<ID of the account>"
13// (Optional) A few recommended callbacks:
14config.onAccountConnected = { data in
15    print("Result: onAccountConnected \(data)")
16}
17config.onAccountError = { data in
18    print("Result: onAccountError \(data)")
19}
20config.onDDSSuccess = { data in
21    print("Result: onDDSSuccess \(data)")
22}
23config.onDDSError = { data in
24    print("Result: onDDSError \(data)")
25}
26config.onTokenExpired = { handler in
27		print("onTokenExpired")
28		// Generate a new user token.
29    // handler(newToken)
30}
31
32ArgyleLink.start(from: viewController, config: config)
33// 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.
1dependencies {
2    implementation 'com.argyle:argyle-link-android:5.x.x'
3}

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.

1val config = LinkConfig(
2    userToken = "USER_TOKEN",
3    sandbox = true // Set to false for production environment.
4)
5// (Optional) Add a Link flow customization created in Console:
6//    config.flowId = "<ID of the Link flow>"
7// (Optional) Add a deposit switch flow:
8//    config.ddsConfig = "<Encrypted target deposit destination value>"
9// (Optional) Limit Link search to specific Items:
10//    config.items = listOf("item_000001422", "item_000025742")
11// (Optional) Connect directly to an existing account:
12//    config.accountId = "<ID of the account>"
13// (Optional) A few recommended callbacks:
14config.onAccountConnected = { data ->
15    Log.d("Result", "onAccountConnected $data")
16}
17config.onAccountError = { data ->
18    Log.d("Result", "onAccountError $data")
19}
20config.onDDSSuccess = { data ->
21    Log.d("Result", "onDDSSuccess $data")
22}
23config.onDDSError = { data ->
24    Log.d("Result", "onDDSError $data")
25}
26config.onTokenExpired = { handler ->
27		// Generate a new user token.
28    // handler(newToken)
29}
30
31ArgyleLink.start(context, config)
32// 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:

    1-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:
1npm 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.

1import { ArgyleLink } from '@argyleio/argyle-plugin-react-native';
2
3// ...
4
5const config = {
6  userToken: 'USER_TOKEN',
7  sandbox: true, // Set to false for production environment.
8  // (Optional) Add a Link flow customization created in Console:
9  //    flowId: '<ID of the Link flow>',
10  // (Optional) Add a deposit switch flow:
11  //    ddsConfig: '<Encrypted target deposit destination value>',
12  // (Optional) Limit Link search to specific Items:
13  //    items: ['item_000001422', 'item_000025742'],
14  // (Optional) Connect directly to an existing account:
15  //    accountId: '<ID of the account>',
16  // (Optional) Callback examples:
17  onAccountConnected: (payload) => console.log('onAccountConnected', payload),
18  onAccountError: (payload) => console.log('onAccountError', payload),
19  onDDSSuccess: (payload) => console.log('onDDSSuccess', payload),
20  onDDSError: (payload) => console.log('onDDSError', payload),
21  onTokenExpired: (updateToken) => {
22    console.log('onTokenExpired');
23    // Generate a new user token.
24    // updateToken(newToken)
25  },
26};
27
28ArgyleLink.start(config);
29// 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:

1android {
2    defaultConfig {
3        minSdkVersion 26 // or greater
4    }
5}

Installing the Flutter SDK#

Add argyle_link_flutter as a dependency in your pubspec.yaml file.

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.

1import 'package:argyle_link_flutter/link_config.dart';
2// (Required if using callbacks) Callback argument type definitions:
3import 'package:argyle_link_flutter/account_data.dart';
4import 'package:argyle_link_flutter/argyle_link.dart';
5import 'package:argyle_link_flutter/form_data.dart';
6
7// ...
8
9final config = LinkConfig(
10  userToken: 'USER_TOKEN',
11  sandbox: true, // Set to false for production environment.
12  // (Optional) Add a Link flow customization created in Console:
13  //    flowId: '<ID of the Link flow>',
14  // (Optional) Add a deposit switch flow:
15  //    ddsConfig: '<Encrypted target deposit destination value>',
16  // (Optional) Limit Link search to specific Items:
17  //    items: ['item_000001422', 'item_000025742'],
18  // (Optional) Connect directly to an existing account:
19  //    accountId: '<ID of the account>',
20  // (Optional) Callback examples:
21  onAccountConnected: (payload) => debugPrint('onAccountConnected'),
22  onAccountError: (payload) => debugPrint('onAccountError'),
23  onDDSSuccess: (payload) => debugPrint('onDDSSuccess'),
24  onDDSError: (payload) => debugPrint('onDDSError'),
25  onTokenExpired: (updateToken) => {
26    debugPrint('onTokenExpired')
27    // Generate a new user token.
28    // updateToken(newToken)
29  },
30);
31
32ArgyleLink.start(config);
33// ArgyleLink.close()   // Manually close Link (typically the user closes Link).
Updating Argyle status...
© 2024 Argyle Systems Inc.argyle.com