Plaid

Plaid API client configuration and integration utilities.

Configuration

Initialize the Plaid client with your API credentials.

import { Configuration, PlaidApi, PlaidEnvironments } from 'plaid'

const configuration = new Configuration({
  basePath: PlaidEnvironments.sandbox,
  baseOptions: {
    headers: {
      'PLAID-CLIENT-ID': process.env.PLAID_CLIENT_ID,
      'PLAID-SECRET': process.env.PLAID_SECRET,
    }
  }
})

export const plaidClient = new PlaidApi(configuration)

Usage

Common Plaid API operations.

// Create a link token
const response = await plaidClient.linkTokenCreate({
  user: { client_user_id: 'user_123' },
  client_name: 'YourBanK',
  products: ['auth', 'transactions'],
  language: 'en',
  country_codes: ['US'],
})

// Exchange public token
const exchangeResponse = await plaidClient.itemPublicTokenExchange({
  public_token: publicToken,
})

// Get accounts
const accountsResponse = await plaidClient.accountsGet({
  access_token: accessToken,
})

// Create processor token for Dwolla
const processorTokenResponse = await plaidClient.processorTokenCreate({
  access_token: accessToken,
  account_id: accountId,
  processor: "dwolla"
})

Environment Variables

PLAID_CLIENT_ID=your_client_id
PLAID_SECRET=your_secret_key
PLAID_ENV=sandbox  # or development, production

Features

Type Safety

Full TypeScript support for all Plaid API operations.

Environment Support

Support for sandbox, development, and production environments.

Dwolla Integration

Built-in support for creating Dwolla processor tokens.

Error Handling

Comprehensive error handling for all API operations.