Instantiating Mesh
Initializing Link with /linkToken Endpoint
To initialize Link within your application, the first step is to call the Link Token endpoint. This endpoint provides a short-lived (30 minute), one-time-use token for initializing a Link session using our client-side SDKs.
Step 1: Invoking Mesh Modal Catalogue
The most basic way to initialize Link is to simply pass the userId body param. The userId is a unique ID representing the end user. This identifier is a map to reference which customers you are logging in through Mesh Link
Go ahead and click button below:
Checkout the example request used for the demo:
curl --request POST \
--url https://integration-api.meshconnect.com/api/v1/linktoken \
--header 'accept: application/json' \
--header 'content-type: application/*+json' \
--data '{"userId":"12345"}'
By default, Mesh Link lets users authenticate with more than one provider in one Link session. This is great for portfolio management use cases or when a user wants to transfer from one provider to another within your application. To limit the authentication to one provider, set the restrictMultipleAccounts param to false.
curl --request POST \
--url https://integration-api.meshconnect.com/api/v1/linktoken \
--header 'accept: application/json' \
--header 'content-type: application/*+json' \
--data '
{
"userId": "12345",
"restrictMultipleAccounts": true
}
'
Step 2a: Invoking Mesh Modal directly to defiWallet
Many of our customers and UI/UX designers want to load up Link with their buttons and skip our Full Catalogue. This is easily achieved passing the integrationId of Exchange/Broker or Defi Wallet.
- Skipping Mesh Catalogue allows you to use unique buttons on the front end for popular wallets.
- You will need to call Get API Status to get the individual identifiers for the wallets integrationId. Storing a copy or fetching in realtime are viable options
Example Request:
curl --request POST \
--url https://integration-api.meshconnect.com/api/v1/linktoken \
--header 'accept: application/json' \
--header 'content-type: application/*+json' \
--data '
{
"userId": "12345",
"restrictMultipleAccounts": true,
"integrationId":"34aeb688-decb-485f-9d80-b66466783394" //metamask identifier
}
Step 2b: Invoking Mesh Modal directly to Broker or Exchange
Using the same Integrations endpoint, to fetch the integration Id, we'll use an Exchange identifier to open Coinbase
You can programmatically obtain the integrationId
value by calling our /api/v1/integrations
endpoint or by accessing it in the Integrations tab.
Example Request:
curl --request POST \
--url https://integration-api.meshconnect.com/api/v1/linktoken \
--header 'accept: application/json' \
--header 'content-type: application/*+json' \
--data '
{
"userId": "12345",
"integrationId": "47624467-e52e-4938-a41a-7926b6c27acf " //coinbase id
}
'
Congrats you've experienced all the ways/views of our Link Authentication workflow. Now let's continue our Authentication workshop by using our Access Token to call a Provider.
Click Next