Skip to main content
You can launch Plaid Link from your own interface without embedding a Layer React component. Your application controls the button, loading states, and account-selection experience, while Layer creates the Plaid Link token, securely stores the resulting access token, and imports account activity. This guide uses Plaid’s React SDK in its examples. You can follow the same API flow with another Plaid Link SDK.

Prerequisites

Before starting, you will need: Install Plaid’s React SDK:
1

Generate business scoped access token

Follow Authentication to generate an access token for the Layer business.
2

Request a Plaid Link token

When the customer chooses to connect an account, request a short-lived Link token from Layer.
Layer returns the token that your frontend will pass to Plaid:
Request a new Link token each time the customer starts a new linking session. Do not persist or reuse it.For an implementation example, see the layer-react Link-token request.
3

Open Plaid Link

Initialize Plaid Link with the token returned by Layer. Open the modal only after the SDK reports that it is ready:
Plaid owns the credential-entry modal. Your application owns the interface that launches it and the experience shown before and after it.For an implementation example, see how layer-react initializes and opens Plaid Link.
4

Exchange the public token

Plaid calls onSuccess with a short-lived public token and institution metadata. Send both to Layer:
The institution value may be null. After a successful exchange, Layer securely stores the Plaid access token and begins importing account data.
Do not exchange the public token directly with Plaid. Layer must perform the exchange so it can manage the Plaid Item and synchronize its accounts.
For implementation examples, see the layer-react exchange request and success handler.
5

Load the connected accounts

After the exchange succeeds, call List bank accounts:
cURL
A newly connected account may still be synchronizing. Poll the endpoint while any entry in external_accounts has is_syncing set to true. As a reference, layer-react polls every five seconds and stops after 15 minutes.For implementation examples, see the layer-react bank-account request and polling configuration.
6

Confirm which accounts belong to the business

Layer pauses data synchronization for accounts that require confirmation. An external account requires relevance confirmation when its notifications array contains:
If the customer uses the account for their business, call Confirm external account:
cURL
If the account is not used for the business, call Exclude external account:
cURL
Use the external account’s id, not the containing bank account’s id. Refetch the bank accounts after processing every selection. Confirming a relevant account allows Layer to begin synchronizing it.For implementation examples, see how layer-react identifies accounts requiring confirmation and submits confirmations and exclusions.

Repair a Plaid connection

When an external account has a non-null connection_needs_repair_as_of value, request an update-mode Link token. Pass that external account’s connection_external_id as plaid_item_id:
cURL
Open Plaid Link with the returned link_token using the same process described above. After Plaid calls onSuccess, do not exchange the public token. Instead, ask Layer to refresh the connection status:
cURL
Then refetch the business’s bank accounts. For implementation examples, see the layer-react update-mode token request and update-mode success handling.

Handle failures

Your interface should let the customer retry each network operation independently:
  • If Link-token creation fails, keep the customer on your connection screen and request a new token when they retry.
  • If the customer exits Plaid Link, discard the Link token.
  • If the public-token exchange fails, show an error and let the customer start a new linking session.
  • If account synchronization takes longer than expected, stop polling and provide a manual refresh action.