SDKs overview
Plaid provides Software Development Kits (SDKs) and client libraries designed to facilitate interaction with its API. These tools abstract the complexity of direct HTTP requests and responses, offering idiomatic interfaces for various programming languages and platforms. The primary components of Plaid's SDK ecosystem include server-side libraries for API interaction and client-side (frontend) SDKs, notably for Plaid Link, the user interface for connecting financial accounts.
The server-side SDKs handle authentication, request signing, and response parsing for the Plaid API. The client-side Plaid Link SDKs (for web, iOS, Android, React Native) manage the user experience for linking accounts, providing a pre-built, secure, and compliant flow for users to authenticate with their financial institutions. This approach aims to reduce integration time and ensure adherence to security best practices, such as OAuth 2.0 authorization flows and data encryption.
Plaid's SDKs are designed to support all of its core products, including Transactions for historical data, Auth for account and routing numbers, Identity for identity verification, and Signal for instant ACH risk scoring. This comprehensive support allows developers to integrate various financial functionalities into their applications using a consistent set of tools (Plaid SDKs documentation).
Official SDKs by language
Plaid maintains a suite of official SDKs for popular programming languages and mobile platforms, ensuring compatibility and optimized performance with its API. These libraries are regularly updated to reflect API changes and new features. The following table outlines the key official SDKs:
| Language/Platform | Package/Module | Typical Installation Command | Maturity/Type |
|---|---|---|---|
| Node.js | plaid |
npm install plaid or yarn add plaid |
Server-side API client |
| Python | plaid-python |
pip install plaid-python |
Server-side API client |
| Ruby | plaid-ruby |
gem install plaid-ruby |
Server-side API client |
| PHP | plaid/plaid-php |
composer require plaid/plaid-php |
Server-side API client |
| Java | com.plaid.client:plaid-java |
Maven/Gradle dependency | Server-side API client |
| Go | github.com/plaid/plaid-go |
go get github.com/plaid/plaid-go/v2 |
Server-side API client |
| iOS | PlaidLinkKit |
CocoaPods: pod 'PlaidLinkKit' |
Client-side (Link UI) |
| Android | com.plaid.link:sdk |
Gradle dependency | Client-side (Link UI) |
| React Native | react-native-plaid-link-sdk |
npm install react-native-plaid-link-sdk |
Client-side (Link UI) |
Installation
Installation procedures for Plaid SDKs vary by language and platform, leveraging standard package managers. Before installation, developers typically need to obtain API keys from the Plaid Dashboard, which include a client_id and secret for API access, and a public_key (deprecated for newer integrations, replaced by Link tokens) for client-side Link initialization. Access to the Plaid API reference provides detailed instructions for each SDK.
Node.js
npm install plaid
Python
pip install plaid-python
Ruby
gem install plaid-ruby
PHP
composer require plaid/plaid-php
Java (Maven)
<dependency>
<groupId>com.plaid.client</groupId>
<artifactId>plaid-java</artifactId>
<version>10.0.0</version> <!-- Use the latest version -->
</dependency>
Go
go get github.com/plaid/plaid-go/v2
iOS (CocoaPods)
platform :ios, '12.0'
use_frameworks!
target 'YourApp' do
pod 'PlaidLinkKit', '~> 4.0'
end
Android (Gradle)
dependencies {
implementation 'com.plaid.link:sdk:4.0.0' <!-- Use the latest version -->
}
React Native
npm install react-native-plaid-link-sdk
yarn add react-native-plaid-link-sdk && cd ios && pod install && cd ..
Quickstart example
A common initial integration task with Plaid is to launch Plaid Link to allow a user to connect their bank account. This typically involves a server-side component to create a Link token and a client-side component to launch Link using that token. The following example demonstrates a simplified Node.js quickstart for generating a Link token:
Server-side (Node.js) - Generate a Link Token:
const { Configuration, PlaidApi, Products, CountryCode } = require('plaid');
const configuration = new Configuration({
basePath: PlaidApi.environments.development,
baseOptions: {
headers: {
'PLAID-CLIENT-ID': process.env.PLAID_CLIENT_ID,
'PLAID-SECRET': process.env.PLAID_SECRET,
},
},
});
const client = new PlaidApi(configuration);
async function createLinkToken() {
const request = {
user: {
client_user_id: 'user-id',
},
client_name: 'Plaid Quickstart',
products: [Products.Auth, Products.Transactions],
country_codes: [CountryCode.Us],
language: 'en',
};
try {
const createTokenResponse = await client.linkTokenCreate(request);
return createTokenResponse.data.link_token;
} catch (error) {
console.error('Error creating Link token:', error.response.data);
// Handle error appropriately
return null;
}
}
createLinkToken().then(linkToken => {
if (linkToken) {
console.log('Generated Link Token:', linkToken);
// Send this linkToken to your client-side application
}
});
Client-side (React) - Launch Plaid Link:
import React, { useEffect, useState } from 'react';
import { usePlaidLink } from 'react-plaid-link';
const PlaidLinkComponent = () => {
const [linkToken, setLinkToken] = useState(null);
useEffect(() => {
async function getLinkToken() {
// In a real application, fetch this from your backend
const response = await fetch('/api/create_link_token');
const data = await response.json();
setLinkToken(data.link_token);
}
getLinkToken();
}, []);
const onSuccess = (public_token, metadata) => {
// Send public_token to your backend to exchange for an access_token
console.log('Public Token:', public_token);
console.log('Metadata:', metadata);
};
const onEvent = (eventName, metadata) => {
console.log('Plaid Link Event:', eventName, metadata);
};
const onExit = (err, metadata) => {
console.log('Plaid Link exited:', err, metadata);
};
const { open, ready, error } = usePlaidLink({
token: linkToken,
onSuccess,
onEvent,
onExit,
});
return (
<button onClick={() => open()} disabled={!ready || !linkToken}>
Connect bank account
</button>
);
};
export default PlaidLinkComponent;
After a user successfully connects their account via Plaid Link, the client-side application receives a public_token. This token is then sent to the developer's server-side application, which exchanges it for an access_token using the Plaid API's itemPublicTokenExchange endpoint. The access_token is a sensitive credential used by the server to access a user's financial data (Plaid Link flow documentation).
Community libraries
Beyond the officially supported SDKs, the broader developer community has contributed libraries and integrations that extend Plaid's reach or address specific use cases. While not officially maintained by Plaid, these libraries can offer alternative approaches or support for less common environments. Developers should evaluate community-contributed code for maintenance status, security practices, and compatibility with the latest Plaid API versions before incorporating them into production systems. Examples of such community contributions might include:
- Unofficial client wrappers: Libraries for languages not officially supported, or alternative implementations focusing on specific frameworks.
- Utility tools: Scripts or small packages designed to assist with specific tasks, such as webhook verification or data transformation.
- Framework integrations: Modules or plugins that simplify integration within specific web frameworks (e.g., Django, Ruby on Rails) by providing pre-configured components or patterns.
It is generally recommended to prioritize official SDKs due to their direct support from Plaid, guaranteed compatibility, and regular updates. For unlisted environments, developers can interact directly with the Plaid REST API, which adheres to standard architectural principles, using any HTTP client library (Plaid documentation on API access).