Before you start
Before you set up your Web integration, you must enablelocalStorage within your WebView and keep it enabled. Set these parameters (or the equivalent parameters in your WebView provider):
domStorageEnabledmust be set totrue.incognitomust be set tofalse.
Setup
To set up a web integration, include the Argyle Link initialization HTML in your application’s configuration. You can copy-paste this initialization example into a.html file, then replace YOUR_LINK_KEY with your own Link key to run Link. Find your Link key in the Link keys section of Argyle Console.
Web initialization example:
The
apiHost in this initialization example is set to the Argyle Sandbox API (https://api-sandbox.argyle.com/v1). It’s a good idea to test your implementation in Sandbox mode first, then change this to the Production API (https://api.argyle.com/v1) when you are ready to go live.Closing Link programmatically
Normally, the user closes Link but you can also close it by calling theclose method of the Link instance returned by Argyle.create.
Configuration
Argyle Link provides multiple configuration options and callbacks that customize how this UI element functions in your application. The only argument that is mandatory when invoking Argyle Link is thelinkKey, which you can find in the Link keys section of Argyle Console.
By default, anytime Argyle Link is initialized, it will be treated as a new session for a new user. To ensure your users retain their previous state in Argyle Link when it is re-initialized for them, your application must use the userToken parameter.
For a full list of Link configuration parameters, see the Link reference.
User tokens
User tokens are temporary access keys that let you start Argyle Link for an existing user. Tokens are short-lived. Generate a new token using the API every time you initialize Argyle Link for a returning user. You can create user tokens using the/user-tokens endpoint.
Make sure that you request user tokens on your server-side and your
client_id and client_secret are never exposed on the front-end.