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 three required parameters, in addition to a number of optional parameters that are used to add customizations and additional Link features.
Required initialization parameters#
Parameter | Type | Description |
---|---|---|
linkKey | string | Associates the embedded instance of Link with your Argyle account. Your Link keys can be found in the Developers section of Console. Note — Link keys are available for the Sandbox and Production environments. Make sure the Link key used in the initialization matches the sandbox parameter's environment. |
sandbox | boolean   | Determines Link's environment — true for Sandbox, false for Production. |
userToken    | string | Argyle utilizes user tokens to identify and authenticate users. See our dedicated User Tokens Guide for more information. |
Optional initialization parameters#
Parameter | Type | Description |
---|---|---|
flowId | string | ID used to customize the Link flow. Saved IDs can be found in the Link Flows section of Console. Formerly named customizationId (deprecated) in Link 4.IDs of previously created customizations can be used with the flowId parameter. |
ddsConfig | string | Used to initialize a deposit switch. |
items | array of strings | Limits 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. |
accountId | string | Used for direct logins to an account that the user has previously connected or attempted to connect. |
<Callback Name> Â Â | string | Callbacks are activated by specific events in Link. |
Web#
Before you start#
- When using a webview component, make sure
localStorage
is always enabled, and setdomStorageEnabled
totrue
andincognito
tofalse
. - 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:" />
Implementing Link for web#
- Log in to Console and retrieve a copy of your Link key.
- Create a user token:
- Create a new user by sending a POST request to the API's
/users
endpoint. - The response payload will include an
id
anduser_token
. - Save the
id
for quickly creating user tokens for this user in the future. - Pass the
user_token
as the value for theuserToken
parameter in your Link initialization.
Initialize Link using the HTML below, replacing the Link key and user token.
Make sure the Link key matches the environment of the sandbox
parameter.
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 linkKey: 'YOUR_LINK_KEY',
14 userToken: 'USER_TOKEN',
15 sandbox: true, // Set to false for production environment.
16 // (Optional) Add a Link flow customization created in Console:
17 // flowId: '<ID of the Link flow>',
18 // (Optional) Add a deposit switch flow:
19 // ddsConfig: '<Encrypted target deposit destination value>',
20 // (Optional) Limit Link search to specific Items:
21 // items: ['item_000001422', 'item_000025742'],
22 // (Optional) Connect directly to an existing account:
23 // accountId: '<ID of the account>',
24 // (Optional) A few recommended callbacks:
25 onAccountConnected: payload => console.log('onAccountConnected', payload),
26 onAccountError: payload => console.log('onAccountError', payload),
27 onDDSSuccess: payload => console.log('onDDSSuccess', payload),
28 onDDSError: payload => console.log('onDDSError', payload),
29 onTokenExpired: updateToken => {
30 console.log('onTokenExpired')
31 // Generate a new user token.
32 // updateToken(newToken)
33 }
34 })
35 linkInstance.open()
36 // linkInstance.close() // Manually close Link (typically the user closes Link).
37 </script>
38 </body>
39</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.
Installing the iOS SDK#
Requirements: iOS 14.0+, Xcode 14.0+, Swift 5.5+
If using Cocoapods:
- In the
Podfile
of your Xcode project, addpod 'Argyle', '<Version Number>'
- Run
pod install
to install the Argyle pod - 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>
Implementing Link for iOS#
- Log in to Console and retrieve a copy of your Link key.
- Create a user token:
- Create a new user by sending a POST request to the API's
/users
endpoint. - The response payload will include an
id
anduser_token
. - Save the
id
for quickly creating user tokens for this user in the future. - Pass the
user_token
as the value for theuserToken
parameter in your Link initialization.
Initialize Link using the configuration below, replacing the Link key and user token.
Make sure the Link key matches the environment of the sandbox
parameter.
1var config = LinkConfig(
2 linkKey: "YOUR_LINK_KEY",
3 userToken: "USER_TOKEN",
4 sandbox: true // Set to false for production environment.
5)
6// (Optional) Add a Link flow customization created in Console:
7// config.flowId = "<ID of the Link flow>"
8// (Optional) Add a deposit switch flow:
9// config.ddsConfig = "<Encrypted target deposit destination value>"
10// (Optional) Limit Link search to specific Items:
11// config.items = ["item_000001422", "item_000025742"]
12// (optional) Connect directly to an existing account:
13// config.accountId = "<ID of the account>"
14// (Optional) A few recommended callbacks:
15config.onAccountConnected = { data in
16 print("Result: onAccountConnected \(data)")
17}
18config.onAccountError = { data in
19 print("Result: onAccountError \(data)")
20}
21config.onDDSSuccess = { data in
22 print("Result: onDDSSuccess \(data)")
23}
24config.onDDSError = { data in
25 print("Result: onDDSError \(data)")
26}
27config.onTokenExpired = { handler in
28 print("onTokenExpired")
29 // Generate a new user token.
30 // handler(newToken)
31}
32
33ArgyleLink.start(from: viewController, config: config)
34// 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.
Installing the Android SDK#
Requirements: Android 8.0 (API level 26) and above, Kotlin 1.7.10+, Android Gradle Plugin 7.2+, Gradle 7.2+
- Add the line below within the dependencies of your
build.gradle
configuration file. - Sync your Android project to import the build configuration changes.
1dependencies { 2 implementation 'com.argyle:argyle-link-android:5.x.x' 3}
Implementing Link for Android#
- Log in to Console and retrieve a copy of your Link key.
- Create a user token:
- Create a new user by sending a POST request to the API's
/users
endpoint. - The response payload will include an
id
anduser_token
. - Save the
id
for quickly creating user tokens for this user in the future. - Pass the
user_token
as the value for theuserToken
parameter in your Link initialization.
Initialize Link using the configuration below, replacing the Link key and user token.
Make sure the Link key matches the environment of the sandbox
parameter.
1val config = LinkConfig( 2 linkKey = "YOUR_LINK_KEY", 3 userToken = "USER_TOKEN", 4 sandbox = true // Set to false for production environment. 5) 6// (Optional) Add a Link flow customization created in Console: 7// config.flowId = "<ID of the Link flow>" 8// (Optional) Add a deposit switch flow: 9// config.ddsConfig = "<Encrypted target deposit destination value>" 10// (Optional) Limit Link search to specific Items: 11// config.items = listOf("item_000001422", "item_000025742") 12// (Optional) Connect directly to an existing account: 13// config.accountId = "<ID of the account>" 14// (Optional) A few recommended callbacks: 15config.onAccountConnected = { data -> 16 Log.d("Result", "onAccountConnected $data") 17} 18config.onAccountError = { data -> 19 Log.d("Result", "onAccountError $data") 20} 21config.onDDSSuccess = { data -> 22 Log.d("Result", "onDDSSuccess $data") 23} 24config.onDDSError = { data -> 25 Log.d("Result", "onDDSError $data") 26} 27config.onTokenExpired = { handler -> 28 // Generate a new user token. 29 // handler(newToken) 30} 31 32ArgyleLink.start(context, config) 33// 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 version 0.65.0 or higher
iOS-specific requirements: iOS 14.0+
Android-specific notes:
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#
- Navigate to the directory for your React Native project.
- Install the packages from your terminal:
1npm install @argyleio/argyle-plugin-react-native --save
After installation:
- Run
cd ios
to navigate to theios
folder. - Run
pod install
to install the Argyle pod. - Run
pod update
to ensure the most recent Argyle pod is installed.
Implementing Link for React Native#
- Log in to Console and retrieve a copy of your Link key.
- Create a user token:
- Create a new user by sending a POST request to the API's
/users
endpoint. - The response payload will include an
id
anduser_token
. - Save the
id
for quickly creating user tokens for this user in the future. - Pass the
user_token
as the value for theuserToken
parameter in your Link initialization.
Initialize Link using the configuration below, replacing the Link key and user token.
Make sure the Link key matches the environment of the sandbox
parameter.
1import { ArgyleLink } from '@argyleio/argyle-plugin-react-native';
2
3// ...
4
5const config = {
6 linkKey: 'YOUR_LINK_KEY',
7 userToken: 'USER_TOKEN',
8 sandbox: true, // Set to false for production environment.
9 // (Optional) Add a Link flow customization created in Console:
10 // flowId: '<ID of the Link flow>',
11 // (Optional) Add a deposit switch flow:
12 // ddsConfig: '<Encrypted target deposit destination value>',
13 // (Optional) Limit Link search to specific Items:
14 // items: ['item_000001422', 'item_000025742'],
15 // (Optional) Connect directly to an existing account:
16 // accountId: '<ID of the account>',
17 // (Optional) Callback examples:
18 onAccountConnected: (payload) => console.log('onAccountConnected', payload),
19 onAccountError: (payload) => console.log('onAccountError', payload),
20 onDDSSuccess: (payload) => console.log('onDDSSuccess', payload),
21 onDDSError: (payload) => console.log('onDDSError', payload),
22 onTokenExpired: (updateToken) => {
23 console.log('onTokenExpired');
24 // Generate a new user token.
25 // updateToken(newToken)
26 },
27};
28
29ArgyleLink.start(config);
30// 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
- Android 8.0 (API level 26) and above, Kotlin 1.7.10+, Android Gradle Plugin 7.2+, Gradle 7.2+
Additionally, 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.
Implementing Link for Flutter#
- Log in to Console and retrieve a copy of your Link key.
- Create a user token:
- Create a new user by sending a POST request to the API's
/users
endpoint. - The response payload will include an
id
anduser_token
. - Save the
id
for quickly creating user tokens for this user in the future. - Pass the
user_token
as the value for theuserToken
parameter in your Link initialization.
Initialize Link using the configuration below, replacing the Link key and user token.
Make sure the Link key matches the environment of the sandbox
parameter.
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 linkKey: 'YOUR_LINK_KEY', 11 userToken: 'USER_TOKEN', 12 sandbox: true, // Set to false for production environment. 13 // (Optional) Add a Link flow customization created in Console: 14 // flowId: '<ID of the Link flow>', 15 // (Optional) Add a deposit switch flow: 16 // ddsConfig: '<Encrypted target deposit destination value>', 17 // (Optional) Limit Link search to specific Items: 18 // items: ['item_000001422', 'item_000025742'], 19 // (Optional) Connect directly to an existing account: 20 // accountId: '<ID of the account>', 21 // (Optional) Callback examples: 22 onAccountConnected: (payload) => debugPrint('onAccountConnected'), 23 onAccountError: (payload) => debugPrint('onAccountError'), 24 onDDSSuccess: (payload) => debugPrint('onDDSSuccess'), 25 onDDSError: (payload) => debugPrint('onDDSError'), 26 onTokenExpired: (updateToken) => { 27 debugPrint('onTokenExpired') 28 // Generate a new user token. 29 // updateToken(newToken) 30 }, 31); 32 33ArgyleLink.start(config); 34// ArgyleLink.close() // Manually close Link (typically the user closes Link).